From: | Piotr Stefaniak <postgres(at)piotr-stefaniak(dot)me> |
---|---|
To: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [BUGS] Breakage with VACUUM ANALYSE + partitions |
Date: | 2016-05-06 05:38:09 |
Message-ID: | BLU436-SMTP16337C9F8B76753D33256FF27D0@phx.gbl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs pgsql-hackers |
On 2016-05-05 09:32, Fabien COELHO wrote:
>> I note that C99 specifically mentions this as something a compiler
>> might warn about: [...]
>
> Indeed. Neither gcc nor clang emit such warnings... but they might some
> day, which would be a blow for my suggestion!
For what it's worth, newer versions of clang can emit useful warnings
for cases like this:
int main(void) {
enum test { FOUR = 4 };
enum incompatible { INCOMPATIBLE_FOUR = 4 };
enum test variable;
variable = INCOMPATIBLE_FOUR;
variable = 5;
variable = 4;
variable = 3;
return 0;
}
enum.c:5:13: warning: implicit conversion from enumeration type 'enum
incompatible' to different enumeration type 'enum test' [-Wenum-conversion]
variable = INCOMPATIBLE_FOUR;
~ ^~~~~~~~~~~~~~~~~
enum.c:6:13: warning: integer constant not in range of enumerated type
'enum test' [-Wassign-enum]
variable = 5;
^
enum.c:8:13: warning: integer constant not in range of enumerated type
'enum test' [-Wassign-enum]
variable = 3;
^
3 warnings generated.
So with -Wenum-conversion -Wassign-enum you could treat enum types as
distinct and incompatible with each other.
From | Date | Subject | |
---|---|---|---|
Next Message | cwire4 | 2016-05-06 06:55:28 | BUG #14126: INSERT ON CONFLICT DO NOTHING auto increments serial primary key when no insert happens. |
Previous Message | John McKown | 2016-05-05 11:37:06 | Re: BUG #14121: Constraint UNIQUE |
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2016-05-06 05:45:25 | Re: old_snapshot_threshold's interaction with hash index |
Previous Message | Amit Kapila | 2016-05-06 03:56:12 | Re: Initial release notes created for 9.6 |