From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51417 invoked by alias); 4 Oct 2018 03:36:23 -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 51406 invoked by uid 89); 4 Oct 2018 03:36:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=cxx X-HELO: sessmg23.ericsson.net Received: from sessmg23.ericsson.net (HELO sessmg23.ericsson.net) (193.180.251.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Oct 2018 03:36:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1538624178; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0SZk/MNxwHR9VSms9qPdIKSP8fh1dllHu+FkMpxnSVw=; b=Ns9LMRYsHozkTCLSHe5rM8v1X1CoNYmlFhqfZFnM8W2Yh04MNfoBY7mvSk2XqZaU O+rJJR/G2KxKVS3oNWdOjYZvk+6Dia5caoZCOGdFQBOvT3lqK/BGzOsMFytSAD1a tshX49ZbMpZpbZupDxgcTo/Or52jz2E6SyIkbfTm6fs=; Received: from ESESBMB504.ericsson.se (Unknown_Domain [153.88.183.117]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 47.75.22015.2BA85BB5; Thu, 4 Oct 2018 05:36:18 +0200 (CEST) Received: from ESESBMB504.ericsson.se (153.88.183.171) by ESESBMB504.ericsson.se (153.88.183.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 4 Oct 2018 05:36:18 +0200 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB504.ericsson.se (153.88.183.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Thu, 4 Oct 2018 05:36:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bUFEvXTOz+QF8RGiTaxm/dgQaHKJkCV6r1R9/C27TnQ=; b=gZUI9Ep0UlOOFWw6RpJayvI1nuaSoKA6ICx/orXjfaYB/dpuildfN2++6byNlRzogVhA0PfbrJrB3gnegV+dgOtpqukLs60OubvHo/ypeuQSgwCz2YVmJpu+P6pvLYN5PpuceAyc2mr9uaw3D4cNVu2XB7Fo7Gyqnbtz/6iXT4w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from [10.0.0.110] (192.222.164.54) by DM6PR15MB2393.namprd15.prod.outlook.com (2603:10b6:5:8d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.25; Thu, 4 Oct 2018 03:36:15 +0000 Subject: Re: [PATCH 1/8] Simple -Wshadow=local fixes To: Tom Tromey , References: <20180923040814.27941-1-tom@tromey.com> <20180923040814.27941-2-tom@tromey.com> From: Simon Marchi Message-ID: <3ce6c920-3474-d5a3-db27-4fffc1d2d5b3@ericsson.com> Date: Thu, 04 Oct 2018 03:36:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180923040814.27941-2-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-Path: simon.marchi@ericsson.com Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00102.txt.bz2 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