Avoid suspects casts VARHDRSZ (c.h) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Avoid suspects casts VARHDRSZ (c.h)
Date
Msg-id CAEudQArKoEwofiQJJA2AEv--YZixqX60xJB0=Cn0x8O8Uz4oRw@mail.gmail.com
Whole thread Raw
Responses Re: Avoid suspects casts VARHDRSZ (c.h)
List pgsql-hackers
Hi,

In all the static analysis tools I’ve used, there are literally *hundreds* of alerts about a one suspect cast:

64 bits sizet_t -> 32 bits int -> 64 bits size_t
-#define VARHDRSZ ((int32) sizeof(int32))
+#define VARHDRSZ (sizeof(int32))

Is there any special reason for not simplifying this and avoiding these alerts?
Passed 100% with vcregress check and in use in local tests.

regards,
Ranier Vilela
Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Logical replication CPU-bound with TRUNCATE/DROP/CREATE many tables
Next
From: David Rowley
Date:
Subject: Re: Get rid of runtime handling of AlternativeSubPlan?