From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5233 invoked by alias); 29 Nov 2011 19:18:44 -0000 Received: (qmail 5225 invoked by uid 22791); 29 Nov 2011 19:18:43 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Nov 2011 19:18:18 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pATJHthe024086 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 29 Nov 2011 14:17:55 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pATJHtEA016297; Tue, 29 Nov 2011 14:17:55 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id pATJHrOE029525; Tue, 29 Nov 2011 14:17:53 -0500 From: Tom Tromey To: Joel Brobecker Cc: Andrey Smirnov , gdb-patches Subject: Re: [PATCH 18/348] Fix -Wsahdow warnings References: <201111231640.pANGefc4031803@d06av02.portsmouth.uk.ibm.com> <201111231820.40486.pedro@codesourcery.com> <201111232023.pANKNcLf022983@glazunov.sibelius.xs4all.nl> <20111124220057.GU13809@adacore.com> <20111125142615.GV13809@adacore.com> Date: Tue, 29 Nov 2011 19:18:00 -0000 In-Reply-To: <20111125142615.GV13809@adacore.com> (Joel Brobecker's message of "Fri, 25 Nov 2011 06:26:15 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00828.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> As to the final decision of enabling -Wshadow by default, I agree Joel> a little more to the idea, although not quite convinced yet. So far, Joel> Eli is pro. Mark is against. I'm 50/50. Unless we get more feedback Joel> from other GMs, you've done the work, we could at least try it and Joel> see where that gets us. I'm generally in favor of it. I think it is unfortunate that it causes us to rename variables when they clash in a way that is unimportant in practice. This is the function-version-scalar issue that Mark points out. However, I have also run across code in gdb where there is local shadowing which has confused me (no example at hand though, sorry). I would like to see these cleaned up. On balance I don't really care that we have to rename some variables in order to get rid of the bad code. There are plenty of names that are equally clear as the ones already in the code. Could we possibly mandate that -Wshadow only be used with a GCC that has Alan Modra's patch in it? Joel pinged it, and it went in, though I didn't see the actual patch: http://gcc.gnu.org/ml/gcc-patches/2011-11/msg02340.html Still, what it does is prevent the warning when shadowing something from a system header. This seems decent to me and in particular will, I think, largely address Mark's concerns. All we'd need then is a bit of configury. Tom