From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18031 invoked by alias); 23 Nov 2011 20:24:09 -0000 Received: (qmail 18023 invoked by uid 22791); 23 Nov 2011 20:24:08 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Nov 2011 20:23:53 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id pANKNe0w019249; Wed, 23 Nov 2011 21:23:40 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id pANKNcLf022983; Wed, 23 Nov 2011 21:23:38 +0100 (CET) Date: Wed, 23 Nov 2011 20:24:00 -0000 Message-Id: <201111232023.pANKNcLf022983@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: pedro@codesourcery.com CC: gdb-patches@sourceware.org, uweigand@de.ibm.com, andrew.smirnov@gmail.com In-reply-to: <201111231820.40486.pedro@codesourcery.com> (message from Pedro Alves on Wed, 23 Nov 2011 18:20:40 +0000) Subject: Re: [PATCH 18/348] Fix -Wsahdow warnings References: <201111231640.pANGefc4031803@d06av02.portsmouth.uk.ibm.com> <201111231820.40486.pedro@codesourcery.com> 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/msg00656.txt.bz2 > From: Pedro Alves > Date: Wed, 23 Nov 2011 18:20:40 +0000 > > On Wednesday 23 November 2011 16:40:41, Ulrich Weigand wrote: > > Mark Kettenis wrote: > > > > > > From: Andrey Smirnov > > > > Date: Tue, 22 Nov 2011 17:25:56 +0700 > > > > Subject: [PATCH 18/39] Fix -Wshadow warnings. > > > > > > > > * amd64-linux-tdep.c (amd64_canonicalize_syscall): Fix -Wshadow > > > > warnings. > > > > > > Why the hell does -Wshadow complain here? > > > > > > -amd64_canonicalize_syscall (enum amd64_syscall syscall) > > > > +amd64_canonicalize_syscall (enum amd64_syscall syscall_number) > > > > I'd expect this is because the parameter "syscall" shadows the global > > function declaration "syscall" provided by glibc headers: > > > > /usr/include/unistd.h:extern long int syscall (long int __sysno, ...) __THROW; > > Yeah, this is unfortunate because it means you trigger different > shadows on different hosts, or by configuring gdb differently. Indeed. And I'd say this means we can't add -Wshadow to the set of default flags for compiling gdb. > There was this gcc patch > > http://comments.gmane.org/gmane.comp.gcc.patches/244771 > > to stop -Wshadow from complaning about shadowing of symbols in system > headers, but it doesn't seem to have been applied, though it was okayed. I'd argue that -Wshadow should never warn about a local variable shadowing a function. There'sno chance such shadowing is unintentional. It seems a lot of the changes posted up until now are dealing with that type of "conflict". I'd really like to see those dropped from this set.