From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47234 invoked by alias); 4 Oct 2018 12:22:15 -0000 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 Received: (qmail 46876 invoked by uid 89); 4 Oct 2018 12:22:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=recent-ish, 20180906, recentish, HContent-Transfer-Encoding:8bit X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Oct 2018 12:22:13 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w94CM6o7008789 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 4 Oct 2018 08:22:11 -0400 Received: by simark.ca (Postfix, from userid 112) id 9A0471E99C; Thu, 4 Oct 2018 08:22:06 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id E98581E50E; Thu, 4 Oct 2018 08:22:05 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 04 Oct 2018 12:22:00 -0000 From: Simon Marchi To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 1/8] Simple -Wshadow=local fixes In-Reply-To: <3ce6c920-3474-d5a3-db27-4fffc1d2d5b3@ericsson.com> References: <20180923040814.27941-1-tom@tromey.com> <20180923040814.27941-2-tom@tromey.com> <3ce6c920-3474-d5a3-db27-4fffc1d2d5b3@ericsson.com> Message-ID: <1bd3f5fc355ca6ef125b1e51a4371861@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00104.txt.bz2 On 2018-10-03 23:36, Simon Marchi wrote: > On 2018-09-23 12:08 AM, Tom Tromey wrote: >> This fixes all the straightforward -Wshadow=local warnings in gdb. A >> few standard approaches are used here: >> >> * Renaming an inner (or outer, but more commonly inner) variable; >> * Lowering a declaration to avoid a clash; >> * Moving a declaration into a more inner scope to avoid a clash, >> including the special case of moving a declaration into a loop >> header. >> >> I did not consider any of the changes in this patch to be particularly >> noteworthy, though of course they should all still be examined. > > I just noticed this new warning, introduced by this patch: > > CXX mdebugread.o > /home/emaisin/src/binutils-gdb/gdb/mdebugread.c: In function ‘void > parse_partial_symbols(minimal_symbol_reader&, objfile*)’: > /home/emaisin/src/binutils-gdb/gdb/mdebugread.c:3573:42: warning: > ‘name’ may be used uninitialized in this function > [-Wmaybe-uninitialized] > add_psymbol_to_list (name, strlen (name), 1, > ^ > > Simon I don't get the warning with a recent-ish gcc build from source: gcc (GCC) 9.0.0 20180906 (experimental) so it might very well be a false positive. That function is so big I can't really tell... Simon