From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27911 invoked by alias); 25 Nov 2011 15:52:59 -0000 Received: (qmail 27895 invoked by uid 22791); 25 Nov 2011 15:52:57 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Nov 2011 15:52:43 +0000 Received: from md1.u-strasbg.fr (md1.u-strasbg.fr [IPv6:2001:660:2402::186]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id pAPFqQL7033102 ; Fri, 25 Nov 2011 16:52:26 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms8.u-strasbg.fr [130.79.204.17]) by md1.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id pAPFqPq9061695 ; Fri, 25 Nov 2011 16:52:25 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id pAPFqOW2035910 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) ; Fri, 25 Nov 2011 16:52:24 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Joel Brobecker'" , "'Andrey Smirnov'" Cc: "'gdb-patches'" 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> In-Reply-To: <20111125142615.GV13809@adacore.com> Subject: About adding -Wshadow option by default (was Re: [PATCH 18/348] Fix -Wsahdow warnings) Date: Fri, 25 Nov 2011 15:52:00 -0000 Message-ID: <001201ccab8a$39c637b0$ad52a710$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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/msg00700.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Joel Brobecker > Envoy=E9=A0: vendredi 25 novembre 2011 15:26 > =C0=A0: Andrey Smirnov > Cc=A0: gdb-patches > Objet=A0: Re: [PATCH 18/348] Fix -Wsahdow warnings >=20 > > Thanks for bringing that up, that is, IMHO, an excellent example. > > The `block_found' in function conflicts with global variable declared > > in symtab.c and it is not that just their names match, types are very > > similar too one is `struct block **' another is `const struct *block'. >=20 > Hmmm, I don't know how I missed that, as I grep'ed the source code. > Or so I thought. Maybe a typo. >=20 > In this particular case, yes, I agree, we should do something. We might > prefer to rename the global variable, though; I think that a global > variable with that name is bizarre. >=20 > As to the final decision of enabling -Wshadow by default, I agree > a little more to the idea, although not quite convinced yet. So far, > Eli is pro. Mark is against. I'm 50/50. Unless we get more feedback > from other GMs, you've done the work, we could at least try it and > see where that gets us. As you might have noticed from my last errorneous email, -Wshadow is already used by default for Binutils and the cases where it leads to problems are not that common (even though my email was just about one of those cases where a system specific function shadows a local variable...) Anyhow, as it seems to indeed avoid some overlap that could lead to hard to debug errors, I would also be in favor of enabling this, even though my vote shouldn't really have any weight here... Pierre Muller