From patchwork Wed Jun 20 16:43:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 27949 Received: (qmail 109172 invoked by alias); 20 Jun 2018 16:43:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 109147 invoked by uid 89); 20 Jun 2018 16:43:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*ca, Hx-languages-length:1667 X-HELO: sesbmg23.ericsson.net Received: from sesbmg23.ericsson.net (HELO sesbmg23.ericsson.net) (193.180.251.37) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Jun 2018 16:43:53 +0000 Received: from ESESSMB502.ericsson.se (Unknown_Domain [153.88.183.120]) by sesbmg23.ericsson.net (Symantec Mail Security) with SMTP id 02.A4.31551.7448A2B5; Wed, 20 Jun 2018 18:43:51 +0200 (CEST) Received: from ESESSMB502.ericsson.se (153.88.183.163) by ESESSMB502.ericsson.se (153.88.183.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 20 Jun 2018 18:43:51 +0200 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (153.88.183.157) by ESESSMB502.ericsson.se (153.88.183.163) 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; Wed, 20 Jun 2018 18:43:50 +0200 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from elxacz23q12.ericsson.se (129.192.64.65) by BYAPR15MB2392.namprd15.prod.outlook.com (2603:10b6:a02:8d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.19; Wed, 20 Jun 2018 16:43:48 +0000 From: Simon Marchi To: CC: Simon Marchi Subject: [pushed] Remove struct keyword in range-based for-loop Date: Wed, 20 Jun 2018 12:43:35 -0400 Message-Id: <1529513015-1113-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-ClientProxiedBy: YQXPR0101CA0067.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:14::44) To BYAPR15MB2392.namprd15.prod.outlook.com (2603:10b6:a02:8d::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a7e3fb1-7539-4b96-0a77-08d5d6ccff54 X-MS-TrafficTypeDiagnostic: BYAPR15MB2392: X-Exchange-Antispam-Report-Test: UriScan:(37575265505322); X-MS-Exchange-SenderADCheck: 1 X-Forefront-PRVS: 070912876F Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2018 16:43:48.1198 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a7e3fb1-7539-4b96-0a77-08d5d6ccff54 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR15MB2392 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes From: Simon Marchi Fix this with gcc 6.3.0, and make the loop variable const while at it: /home/simark/src/binutils-gdb/gdb/record-full.c: In member function 'virtual int record_full_target::insert_breakpoint(gdbarch*, bp_target_info*)': /home/simark/src/binutils-gdb/gdb/record-full.c:1789:8: error: types may not be defined in a for-range-declaration [-Werror] for (struct record_full_breakpoint &bp : record_full_breakpoints) gdb/ChangeLog: * record-full.c (record_full_target::insert_breakpoint): Remove "struct" keyword, add const. --- gdb/ChangeLog | 5 +++++ gdb/record-full.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c66b686..ff304fe 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-06-20 Simon Marchi + + * record-full.c (record_full_target::insert_breakpoint): Remove + "struct" keyword, add const. + 2018-06-19 Simon Marchi * common/common-defs.h (PACKAGE_NAME, PACKAGE_VERSION, diff --git a/gdb/record-full.c b/gdb/record-full.c index a1bc017..6465ab5 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -1786,7 +1786,7 @@ record_full_target::insert_breakpoint (struct gdbarch *gdbarch, /* Use the existing entries if found in order to avoid duplication in record_full_breakpoints. */ - for (struct record_full_breakpoint &bp : record_full_breakpoints) + for (const record_full_breakpoint &bp : record_full_breakpoints) { if (bp.addr == bp_tgt->placed_address && bp.address_space == bp_tgt->placed_address_space)