Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYcD2-00067j-91 for pgsql-hackers@arkaria.postgresql.org; Tue, 12 May 2020 21:13:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYcD0-0000HV-4g for pgsql-hackers@arkaria.postgresql.org; Tue, 12 May 2020 21:13:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYcCz-0000HO-TV for pgsql-hackers@lists.postgresql.org; Tue, 12 May 2020 21:13:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYcCt-0003gD-Er for pgsql-hackers@lists.postgresql.org; Tue, 12 May 2020 21:13:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 04CLCqqQ007194; Tue, 12 May 2020 17:12:52 -0400 From: Tom Lane To: Alvaro Herrera cc: Julien Rouhaud , PostgreSQL Hackers Subject: Re: Add "-Wimplicit-fallthrough" to default flags (was Re: pgsql: Support FETCH FIRST WITH TIES) In-reply-to: <20200512202524.GA30825@alvherre.pgsql> References: <20200512202524.GA30825@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 12 May 2020 16:25:24 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7192.1589317971.1@sss.pgh.pa.us> Date: Tue, 12 May 2020 17:12:51 -0400 Message-ID: <7193.1589317971@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > Fixed one straggler in contrib, and while testing it I realized why > ccache doesn't pay attention to the changes I was doing in the file: > ccache compares the *preprocessed* version of the file and only if that > differs from the version that was cached last, ccache sends the new one > to the compiler; and of course these comments are not present in the > preprocessed version, so changing only the comment accomplishes nothing. > You have to touch one byte outside of any comments. Ugh. So the only way ccache could avoid this is to drop the preprocessed-file comparison check if -Wimplicit-fallthrough is on. Doesn't really sound like something we'd want to ask them to do. > I bet this is going to bite someone ... maybe we'd be better off going > all the way to -Wimplicit-fallthrough=5 and use the > __attribute__((fallthrough)) stuff instead. I'm not really in favor of the __attribute__ solution --- seems too gcc-specific. FALLTHROUGH-type comments are understood by other sorts of tools besides gcc. In practice, it doesn't seem like this'll be a huge problem once we're past the initial fixup stage. We can revisit it later if that prediction proves wrong, of course. regards, tom lane