From patchwork Thu Oct 3 15:18:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 1171247 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510151-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="KT4Z7UpS"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46kc965fGmz9sCJ for ; Fri, 4 Oct 2019 01:18:50 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:content-type:mime-version; q=dns; s= default; b=ZjPPDzKkjmmzpygduE0mDtBcjkxX61IwQcupfYHzkHH7sxs6KrfXp qrHda0LDWkeLZjWPaioAVLoQoNbZzwgwahko4qFY4vLAitVTCGBKnJXykqS3/AuV uEK5QgsiCo2BnnBiryIVKin0OVYx0usH7xZdiQz2GN+kpr2Sl1AF9o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:content-type:mime-version; s= default; bh=mERozWD++6PLpX0tdgTag3wsjL0=; b=KT4Z7UpS4YWqOKszP1Yd 1n20HWPHG7/DJzSNCJekyQlu2e4szmZ4FgesDkuTy2aU7dB0KPxhjAqLHqdk7M+x vtPDHVB9FIv5U/tVyTzMxW0OGTXh9V6XOWjrhycPxPjBL2xtSiZMeg+W7O3rsoDG wwWKAOys6z/U6s/9vE7u3J8= Received: (qmail 54894 invoked by alias); 3 Oct 2019 15:18:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 54819 invoked by uid 89); 3 Oct 2019 15:18:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=H*c:HHH X-HELO: EUR03-VE1-obe.outbound.protection.outlook.com Received: from mail-oln040092072018.outbound.protection.outlook.com (HELO EUR03-VE1-obe.outbound.protection.outlook.com) (40.92.72.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Oct 2019 15:18:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W0Pz7QfIXocj9KuHFQOxFoP2Utjrrz076w0Io3d7Rg0nlRl0rC93SM1cwZ98qBKwYCN8VGjq65j3iTn9Dsn86ktxP/rCRq8b1rSc/IvkgjkH04bQylpdM0mrTp59tXEvf4lPS+dlE0hHysSo1ioxdueQGHi4MQEZJ1hjW4m/9zlO4vlEjTz3JsskS8f92TP/kBpr7y+6y9niunVCFWU/Lu47G4QBOueh0qZPo8dfe70QHL/FRSbjqz1LQPsCk7K/SbLY2ZpcS//ty6xLj76ieqvoEzn4bS0MY2pEtJQdp0+A4JIQb+72+oCjequTwVsWBDMIw4ZqOtQzmi3+/ht/rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F1MecBj3sQE7QhN1pp0IDQj2EHSNVu81w2LhffzohZU=; b=cq7NrEuJIQs/MDnwoBPT/42KRw7GivnKPiZ2r6kRxzZNhbHcXLuK+S8poUsAmWYiXV74a6/QNauPBL0rDgUya35t5BfiH3FRYP0ed6zpMY6WH/z6dZB8KmQ7wj65y7IYIR44FeBR1tw6PBossOusJs04hw8bR+9yoe3dZYkh4/8i1EhknHbveySd/AbGsTmchGyFCq8aSTjsyZZJOpyU4jX5N15SqvJuapcH+9SFRfns+zwReDO4+qhNtVtrHEe44RpGSn9YJwEB4twSLRtOUpgmESMa0gzRC+sbaQPrqmo5037P2QAwPtONXgTetma/Ifcu+wAOpeVBrT03wBgXSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from AM5EUR03FT057.eop-EUR03.prod.protection.outlook.com (10.152.16.51) by AM5EUR03HT097.eop-EUR03.prod.protection.outlook.com (10.152.17.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2305.15; Thu, 3 Oct 2019 15:18:29 +0000 Received: from VI1PR03MB4528.eurprd03.prod.outlook.com (10.152.16.58) by AM5EUR03FT057.mail.protection.outlook.com (10.152.17.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2305.15 via Frontend Transport; Thu, 3 Oct 2019 15:18:28 +0000 Received: from VI1PR03MB4528.eurprd03.prod.outlook.com ([fe80::1917:2b45:72b0:548a]) by VI1PR03MB4528.eurprd03.prod.outlook.com ([fe80::1917:2b45:72b0:548a%7]) with mapi id 15.20.2305.023; Thu, 3 Oct 2019 15:18:28 +0000 From: Bernd Edlinger To: "gcc-patches@gcc.gnu.org" Subject: [PATCH] Fix -Wshadow=local warnings in cgraph.h Date: Thu, 3 Oct 2019 15:18:28 +0000 Message-ID: x-microsoft-original-message-id: <56fb2f05-dcab-c324-ce91-74d56a4b2309@hotmail.de> x-ms-exchange-transport-forked: True MIME-Version: 1.0 Hi, this fixes a -Wshadow=local warning in the FOR_EACH_ALIAS macro that happens when it is used in lto/lto-partition.c in a nested block. For now to keep the patch simple, using the fact that the ALIAS parameter is always a simple name, concatenate _iter_ to make the loop variable a reserved name. Bootstrapped and reg-tested on x86_64-pc-linux-gnu. Is it OK for trunk? Thanks Bernd. 2019-10-03 Bernd Edlinger * cgraph.h (FOR_EACH_ALIAS): Avoid shadowing the loop variable. Index: gcc/cgraph.h =================================================================== --- gcc/cgraph.h (revision 276484) +++ gcc/cgraph.h (working copy) @@ -648,8 +648,10 @@ symtab_node::checking_verify_symtab_nodes (void) } /* Walk all aliases for NODE. */ -#define FOR_EACH_ALIAS(node, alias) \ - for (unsigned x_i = 0; node->iterate_direct_aliases (x_i, alias); x_i++) +#define FOR_EACH_ALIAS(NODE, ALIAS) \ + for (unsigned ALIAS##_iter_ = 0; \ + (NODE)->iterate_direct_aliases (ALIAS##_iter_, ALIAS); \ + ALIAS##_iter_++) /* This is the information that is put into the cgraph local structure to recover a function. */