Re: [BUGS] Breakage with VACUUM ANALYSE + partitions - Mailing list pgsql-hackers

From Piotr Stefaniak
Subject Re: [BUGS] Breakage with VACUUM ANALYSE + partitions
Date
Msg-id BLU436-SMTP16337C9F8B76753D33256FF27D0@phx.gbl
Whole thread Raw
In response to Re: [BUGS] Breakage with VACUUM ANALYSE + partitions  (Fabien COELHO <coelho@cri.ensmp.fr>)
List 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.




pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Initial release notes created for 9.6
Next
From: Amit Kapila
Date:
Subject: Re: old_snapshot_threshold's interaction with hash index