Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayYSz-0005VL-JR for pgsql-hackers@arkaria.postgresql.org; Fri, 06 May 2016 05:38:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ayYSy-0005kT-Jz for pgsql-hackers@arkaria.postgresql.org; Fri, 06 May 2016 05:38:20 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ayYSx-0005kM-S4 for pgsql-hackers@postgresql.org; Fri, 06 May 2016 05:38:20 +0000 Received: from blu004-omc1s16.hotmail.com ([65.55.116.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ayYSu-00013H-Qv for pgsql-hackers@postgresql.org; Fri, 06 May 2016 05:38:18 +0000 Received: from BLU436-SMTP16 ([65.55.116.8]) by BLU004-OMC1S16.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Thu, 5 May 2016 22:38:15 -0700 X-TMN: [niSDUFILE8G4yc9z9nIft9YrqofnMdTu] X-Originating-Email: [postgres@piotr-stefaniak.me] Message-ID: Subject: Re: [BUGS] Breakage with VACUUM ANALYSE + partitions To: Fabien COELHO , Tom Lane References: <20160429235837.b63wkjw4dduf56wt@alap3.anarazel.de> <20160502164111.cpupbbkab6ik7wwd@alap3.anarazel.de> <20160502165438.yu6inlsyv4babyie@alap3.anarazel.de> <20160502203634.hmjgdumfgqrldo6n@alap3.anarazel.de> <20160502221419.shvm4vuhi4jh5hoe@alap3.anarazel.de> <20160503234810.vzbxwxq4jincgdng@alap3.anarazel.de> <6502.1462373742@sss.pgh.pa.us> <13345.1462383078@sss.pgh.pa.us> CC: "pgsql-hackers@postgresql.org" From: Piotr Stefaniak Date: Fri, 6 May 2016 07:38:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 06 May 2016 05:38:14.0983 (UTC) FILETIME=[7C4D6570:01D1A759] X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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