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 1ohvIY-00032p-P3 for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Oct 2022 16:06:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ohvIW-0000xu-Dz for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Oct 2022 16:06:32 +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 1ohvIV-0000uT-Vc for pgsql-hackers@lists.postgresql.org; Mon, 10 Oct 2022 16:06:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohvIQ-0006G7-HV; Mon, 10 Oct 2022 16:06:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 29AG6MK74139737; Mon, 10 Oct 2022 12:06:22 -0400 From: Tom Lane To: David Rowley cc: Andres Freund , Justin Pryzby , pgsql-hackers@postgresql.org, Tomas Vondra , Peter Smith Subject: Re: shadow variables - pg15 edition In-reply-to: References: <20220830054441.GF31833@telsasoft.com> <20221004023012.GT7745@telsasoft.com> <2321227.1664979561@sss.pgh.pa.us> <20221005214052.c4tkudawyp5wxt3c@awork3.anarazel.de> <20221006003920.6xlqaoccxwisza5k@awork3.anarazel.de> Comments: In-reply-to David Rowley message dated "Fri, 07 Oct 2022 16:51:55 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4139735.1665417982.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 10 Oct 2022 12:06:22 -0400 Message-ID: <4139736.1665417982@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Fri, 7 Oct 2022 at 13:24, David Rowley wrote: >> Since I just committed the patch to fix the final warnings, I think we >> should go ahead and commit the patch you wrote to add >> -Wshadow=3Dcompatible-local to the standard build flags. I don't mind >> doing this. > Pushed. The buildfarm's showing a few instances of this warning, which seem to indicate that not all versions of the Perl headers are clean: fairywren | 2022-10-10 09:03:50 | C:/Perl64/lib/CORE/cop.h:612:13: wa= rning: declaration of 'av' shadows a previous local [-Wshadow=3Dcompatible= -local] fairywren | 2022-10-10 09:03:50 | C:/Perl64/lib/CORE/cop.h:612:13: wa= rning: declaration of 'av' shadows a previous local [-Wshadow=3Dcompatible= -local] fairywren | 2022-10-10 09:03:50 | C:/Perl64/lib/CORE/cop.h:612:13: wa= rning: declaration of 'av' shadows a previous local [-Wshadow=3Dcompatible= -local] fairywren | 2022-10-10 09:03:50 | C:/Perl64/lib/CORE/cop.h:612:13: wa= rning: declaration of 'av' shadows a previous local [-Wshadow=3Dcompatible= -local] fairywren | 2022-10-10 09:03:50 | C:/Perl64/lib/CORE/cop.h:612:13: wa= rning: declaration of 'av' shadows a previous local [-Wshadow=3Dcompatible= -local] fairywren | 2022-10-10 09:03:50 | C:/Perl64/lib/CORE/cop.h:612:13: wa= rning: declaration of 'av' shadows a previous local [-Wshadow=3Dcompatible= -local] snakefly | 2022-10-10 08:21:05 | Util.c:457:14: warning: declaration= of 'cv' shadows a parameter [-Wshadow=3Dcompatible-local] Before you ask: fairywren: perl 5.24.3 snakefly: perl 5.16.3 which are a little old, but not *that* old. Scraping the configure logs also shows that only half of the buildfarm (exactly 50 out of 100 reporting animals) knows -Wshadow=3Dcompatible-loca= l, which suggests that we might see more of these if they all did. On the other hand, animals with newer compilers probably also have newer Perl installations, so assuming that the Perl crew have kept this clean recently, maybe not. Not sure if this is problematic enough to justify removing the switch. A plausible alternative is to have a few animals with known-clean Perl installations add the switch manually (and use -Werror), so that we find out about violations without having warnings in the face of developers who can't fix them. I'm willing to wait to see if anyone complains of such warnings, though. regards, tom lane