From patchwork Fri Oct 4 18:24:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 1171991 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-510298-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="yY0b07XG"; 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 46lJFT5R3Nz9sPl for ; Sat, 5 Oct 2019 04:25:01 +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=TUjeVA5SlLDpzwbRxcWadD1EAZr0d7H/eE5qN4yWwJfHf07+LmV4J f/R7salVcaTjI8s4KCHcqrtfmWlkKiFUsmvV3HgUnZxigYrKAlk89F5mM61MJUsP j60UhwEuuxDAelQuXkxmpydc1TZH93mGNLQAnSJpmn+PJL6UHxBa9U= 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=qmQYU61w6RiAurF8XbX9zcX9GEw=; b=yY0b07XGiBeOL+VzuMUQ fgfUKShRUuZvkakQqMw4dS7wybPXGAoR0tkvwtcQs/9/znPBBjvZW52d+31glHSp DLKLX195n5FgmdyelRBl0TShP+p7VaspI0gsRc25OUSc3ezpgjoLWVBPLTNhS7gB 4vGCm3t+oltFXLJqWrNEuoY= Received: (qmail 94279 invoked by alias); 4 Oct 2019 18:24:53 -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 94219 invoked by uid 89); 4 Oct 2019 18:24:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.0 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=HX-Languages-Length:2536, H*c:HHH X-HELO: EUR03-DB5-obe.outbound.protection.outlook.com Received: from mail-oln040092071109.outbound.protection.outlook.com (HELO EUR03-DB5-obe.outbound.protection.outlook.com) (40.92.71.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 04 Oct 2019 18:24:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BTiY8Zl99WTYrPo53JTaBgjzyBb9twfWDfQZ+orytGRS5n9LcwV5TlBRiujbE1D8WjUOphWbrQbpd+OkNAeP8o2Sc+NwolrUk8hG9/de7nyypXh9qYB/9Rse8w51blCMh09YfgOBJ5qxycdKuhX9IPcnR7YVEQRQbgO1fAhgWiNlMT7wPcc7A2SXHludEBhLLZJicYesz4p/EsGH/XCTwwP4hs/MOjjV7aTeP9vtXCCk7YURmKFrux9uEVMqm+SUx9FA6QNAxY0WNTWnXMQwm7UgqoHN3gEc0k36fYvgtMh7GcXcR71HiP1g86m68jlUdvdn6vib8bZc6K1xyX1/XQ== 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=aC2Jth7FG3HvGnPnWSA/3OAluTOOtDyvEFlzkdZ0Hv0=; b=cGUPgIaQa2MBv2CfdnymCPTz2oqs08chGwVAThNYwTD/q3FzZ6QktAVVlP6pxZfqxYexmmpBQT2jT9Mt0zRvD59i2Uh2nGe0ugE6T3+FbMo3nzWIk2vMUDAzWfRVkpylTlJS2ZylhBlRtkh/R3J5XmpfgB3iHm982cUgTytdohaJmUQpLVN8j3jqpihU/Zkf2CRYT/R1Wi1V+94dZ7RdpwMln+v5rtfcWo7T9A0LDW9RR+9/Z9UMKsOuRAJn0y875bK/+Jjb0jutiDmcTB17KENUuXNO+gugID1Pfo7eNHRte2oZu0+g1NylOSbQyshR/QfAhJZMxFDPphsDRuqWBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from AM5EUR03FT023.eop-EUR03.prod.protection.outlook.com (10.152.16.55) by AM5EUR03HT085.eop-EUR03.prod.protection.outlook.com (10.152.17.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2305.15; Fri, 4 Oct 2019 18:24:45 +0000 Received: from AM6PR03MB4519.eurprd03.prod.outlook.com (10.152.16.54) by AM5EUR03FT023.mail.protection.outlook.com (10.152.16.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2305.15 via Frontend Transport; Fri, 4 Oct 2019 18:24:45 +0000 Received: from AM6PR03MB4519.eurprd03.prod.outlook.com ([fe80::281d:bbf5:fa02:2c3b]) by AM6PR03MB4519.eurprd03.prod.outlook.com ([fe80::281d:bbf5:fa02:2c3b%6]) with mapi id 15.20.2327.023; Fri, 4 Oct 2019 18:24:45 +0000 From: Bernd Edlinger To: "gcc-patches@gcc.gnu.org" Subject: [PATCH] Fix -Wshadow=local warnings in defaults.h Date: Fri, 4 Oct 2019 18:24:45 +0000 Message-ID: x-microsoft-original-message-id: <4199387f-7d3e-4e41-873e-86da030b3c57@hotmail.de> x-ms-exchange-transport-forked: True MIME-Version: 1.0 Hi, this macro caused -Wshadow=local warnings in varasm.c with the microblaze target. Only built a bare metal cross compiler that was able to compile libgcc for that target. Is it OK for trunk? Thanks Bernd. 2019-10-04 Bernd Edlinger * defaults.h (ASM_OUTPUT_ASCII): Rename local vars in macro. Remove variable hiding code. Index: gcc/defaults.h =================================================================== --- gcc/defaults.h (revision 276484) +++ gcc/defaults.h (working copy) @@ -61,37 +61,32 @@ see the files COPYING3 and COPYING.RUNTIME respect #ifndef ASM_OUTPUT_ASCII #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \ do { \ - FILE *_hide_asm_out_file = (MYFILE); \ - const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \ - int _hide_thissize = (MYLENGTH); \ - { \ - FILE *asm_out_file = _hide_asm_out_file; \ - const unsigned char *p = _hide_p; \ - int thissize = _hide_thissize; \ - int i; \ - fprintf (asm_out_file, "\t.ascii \""); \ + FILE *_asm_out_file = (MYFILE); \ + const unsigned char *_p = (const unsigned char *) (MYSTRING); \ + int _thissize = (MYLENGTH); \ + int _i; \ \ - for (i = 0; i < thissize; i++) \ - { \ - int c = p[i]; \ - if (c == '\"' || c == '\\') \ - putc ('\\', asm_out_file); \ - if (ISPRINT (c)) \ - putc (c, asm_out_file); \ - else \ - { \ - fprintf (asm_out_file, "\\%o", c); \ - /* After an octal-escape, if a digit follows, \ - terminate one string constant and start another. \ - The VAX assembler fails to stop reading the escape \ - after three digits, so this is the only way we \ - can get it to parse the data properly. */ \ - if (i < thissize - 1 && ISDIGIT (p[i + 1])) \ - fprintf (asm_out_file, "\"\n\t.ascii \""); \ + fprintf (_asm_out_file, "\t.ascii \""); \ + for (_i = 0; _i < _thissize; _i++) \ + { \ + int _c = _p[_i]; \ + if (_c == '\"' || _c == '\\') \ + putc ('\\', _asm_out_file); \ + if (ISPRINT (_c)) \ + putc (_c, _asm_out_file); \ + else \ + { \ + fprintf (_asm_out_file, "\\%o", _c); \ + /* After an octal-escape, if a digit follows, \ + terminate one string constant and start another. \ + The VAX assembler fails to stop reading the escape \ + after three digits, so this is the only way we \ + can get it to parse the data properly. */ \ + if (_i < _thissize - 1 && ISDIGIT (_p[_i + 1])) \ + fprintf (_asm_out_file, "\"\n\t.ascii \""); \ } \ - } \ - fprintf (asm_out_file, "\"\n"); \ - } \ + } \ + fprintf (_asm_out_file, "\"\n"); \ } \ while (0) #endif