From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25227 invoked by alias); 30 Nov 2011 03:48:05 -0000 Received: (qmail 25174 invoked by uid 22791); 30 Nov 2011 03:48:02 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-yx0-f169.google.com (HELO mail-yx0-f169.google.com) (209.85.213.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Nov 2011 03:47:47 +0000 Received: by yenq10 with SMTP id q10so4614yen.0 for ; Tue, 29 Nov 2011 19:47:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.40.135 with SMTP id x7mr178770igk.48.1322624867083; Tue, 29 Nov 2011 19:47:47 -0800 (PST) Received: by 10.50.186.228 with HTTP; Tue, 29 Nov 2011 19:47:47 -0800 (PST) In-Reply-To: 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: Wed, 30 Nov 2011 03:48:00 -0000 Message-ID: Subject: Re: [PATCH 18/348] Fix -Wsahdow warnings From: Andrey Smirnov To: Tom Tromey Cc: Joel Brobecker , gdb-patches Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg00837.txt.bz2 On Wed, Nov 30, 2011 at 2:17 AM, Tom Tromey wrote: > 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: > > =A0 =A0http://gcc.gnu.org/ml/gcc-patches/2011-11/msg02340.html > I know I probably should go to GCC mailing list and ask that question there, but anyways, would this patch cause gcc to stop generating the warning about local variable shadowing global one from system headers? The reason I'm asking is because there are several instances of said shadowing in GDB, for example https://github.com/ndreys/gdb/commit/bf87d6034f7093aa207a1b14233be48214a6c3= d8 (please ignore the erroneous description, for some unknown reason I call `optarg' `optparse') I hope that kinds of shadowing would still be detectable even with this patch applied. > Still, what it does is prevent the warning when shadowing something from > a system header. =A0This seems decent to me and in particular will, I > think, largely address Mark's concerns. > It would pretty much solve that problem, yes, but still it would divide patch submitters into two groups those who have newest gcc and -Wshadow enabled by default, and those who don't. And the people without -Wshadow enabled compilers would be, on occasion, breaking the build because they have no means to check for -Wshadow caused errors. I hope I missing something and it is not the case, but that how the things seems to me now. Andrey Smirnov