pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Piotr Stefaniak <postgres@piotr-stefaniak.me>
To: Fabien COELHO <coelho@cri.ensmp.fr>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [BUGS] Breakage with VACUUM ANALYSE + partitions
Date: Fri, 6 May 2016 07:38:09 +0200
Message-ID: <BLU436-SMTP16337C9F8B76753D33256FF27D0@phx.gbl> (raw)
In-Reply-To: <alpine.DEB.2.10.1605050738290.30701@sto>
References: <20160429235837.b63wkjw4dduf56wt@alap3.anarazel.de>
	<CA+TgmoZirJKnSAkjZHt8cVRW9Y7yHyWFLNENnT-LkFtBi6oBfw@mail.gmail.com>
	<20160502164111.cpupbbkab6ik7wwd@alap3.anarazel.de>
	<CA+Tgmoajiv-4840wHpx0o-LJ7mqSGrnCtRH8MOoJkL2A-GF2Ww@mail.gmail.com>
	<20160502165438.yu6inlsyv4babyie@alap3.anarazel.de>
	<alpine.DEB.2.10.1605022146390.927@sto>
	<20160502203634.hmjgdumfgqrldo6n@alap3.anarazel.de>
	<alpine.DEB.2.10.1605022346490.927@sto>
	<20160502221419.shvm4vuhi4jh5hoe@alap3.anarazel.de>
	<alpine.DEB.2.10.1605030712070.927@sto>
	<20160503234810.vzbxwxq4jincgdng@alap3.anarazel.de>
	<alpine.DEB.2.10.1605040727090.27782@sto>
	<6502.1462373742@sss.pgh.pa.us>
	<alpine.DEB.2.10.1605041750420.30701@sto>
	<13345.1462383078@sss.pgh.pa.us>
	<alpine.DEB.2.10.1605050738290.30701@sto>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (64+ messages)

Message-ID: <BLU436-SMTP16337C9F8B76753D33256FF27D0@phx.gbl>
Permalink:  ../BLU436-SMTP16337C9F8B76753D33256FF27D0@phx.gbl/
Also on:    postgresql.org/message-id/BLU436-SMTP16337C9F8B76753D33256FF27D0@phx.gbl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: postgres@piotr-stefaniak.me, coelho@cri.ensmp.fr, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: [BUGS] Breakage with VACUUM ANALYSE + partitions
  In-Reply-To: <BLU436-SMTP16337C9F8B76753D33256FF27D0@phx.gbl>
  References: <20160429235837.b63wkjw4dduf56wt@alap3.anarazel.de> <CA+TgmoZirJKnSAkjZHt8cVRW9Y7yHyWFLNENnT-LkFtBi6oBfw@mail.gmail.com> <20160502164111.cpupbbkab6ik7wwd@alap3.anarazel.de> <CA+Tgmoajiv-4840wHpx0o-LJ7mqSGrnCtRH8MOoJkL2A-GF2Ww@mail.gmail.com> <20160502165438.yu6inlsyv4babyie@alap3.anarazel.de> <alpine.DEB.2.10.1605022146390.927@sto> <20160502203634.hmjgdumfgqrldo6n@alap3.anarazel.de> <alpine.DEB.2.10.1605022346490.927@sto> <20160502221419.shvm4vuhi4jh5hoe@alap3.anarazel.de> <alpine.DEB.2.10.1605030712070.927@sto> <20160503234810.vzbxwxq4jincgdng@alap3.anarazel.de> <alpine.DEB.2.10.1605040727090.27782@sto> <6502.1462373742@sss.pgh.pa.us> <alpine.DEB.2.10.1605041750420.30701@sto> <13345.1462383078@sss.pgh.pa.us> <alpine.DEB.2.10.1605050738290.30701@sto> <BLU436-SMTP16337C9F8B76753D33256FF27D0@phx.gbl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox