From patchwork Fri Nov 24 10:05:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philipp Rudo X-Patchwork-Id: 24490 Received: (qmail 14553 invoked by alias); 24 Nov 2017 10:06:16 -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 14404 invoked by uid 89); 24 Nov 2017 10:06:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Nov 2017 10:06:13 +0000 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAOA56Ma034676 for ; Fri, 24 Nov 2017 05:06:11 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2eeefu7skt-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 24 Nov 2017 05:06:11 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Nov 2017 10:06:09 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Nov 2017 10:06:06 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vAOA66a139583968; Fri, 24 Nov 2017 10:06:06 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 50894AE045; Fri, 24 Nov 2017 09:59:19 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2CEC1AE04D; Fri, 24 Nov 2017 09:59:19 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 24 Nov 2017 09:59:19 +0000 (GMT) From: Philipp Rudo To: Sergio Durigan Junior Cc: gdb-patches@sourceware.org Subject: [PATCH] Workaround build bug with GCC 6.2.1 Date: Fri, 24 Nov 2017 11:05:57 +0100 In-Reply-To: <20171124100557.56475-1-prudo@linux.vnet.ibm.com> References: <87efoobx9r.fsf@redhat.com> <20171124100557.56475-1-prudo@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17112410-0016-0000-0000-000005052008 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17112410-0017-0000-0000-00002840F8BA Message-Id: <20171124100557.56475-2-prudo@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-11-24_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711240137 X-IsSubscribed: yes Building GDB with GCC 6.2.1 gives multiple errors like gdb/dtrace-probe.c: In member function ‘void dtrace_probe::build_arg_exprs(gdbarch*)’: gdb/dtrace-probe.c:627:8: error: types may not be defined in a for-range-declaration [-Werror] for (struct dtrace_probe_arg &arg : m_args Fix it by removing the 'struct' keyword. A similar Bug was already fixed for GCC 6.3.1 https://sourceware.org/ml/gdb-patches/2017-10/msg00442.html gdb/ChangeLog: * dtrace-probe.c (dtrace_probe::build_arg_exprs) (dtrace_probe::is_enabled, dtrace_probe::enable) (dtrace_probe::disable): Remove keyword 'struct' at for-range variable * probe.c (gen_ui_out_table_header_info) (print_ui_out_not_applicables): Remove keyword 'struct' at for-range variable --- gdb/dtrace-probe.c | 8 ++++---- gdb/probe.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c index ace3d306a1..1c88f89054 100644 --- a/gdb/dtrace-probe.c +++ b/gdb/dtrace-probe.c @@ -624,7 +624,7 @@ dtrace_probe::build_arg_exprs (struct gdbarch *gdbarch) /* Iterate over the arguments in the probe and build the corresponding GDB internal expression that will generate the value of the argument when executed at the PC of the probe. */ - for (struct dtrace_probe_arg &arg : m_args) + for (dtrace_probe_arg &arg : m_args) { struct cleanup *back_to; struct parser_state pstate; @@ -684,7 +684,7 @@ dtrace_probe::is_enabled () const { struct gdbarch *gdbarch = this->get_gdbarch (); - for (const struct dtrace_probe_enabler &enabler : m_enablers) + for (const dtrace_probe_enabler &enabler : m_enablers) if (!gdbarch_dtrace_probe_is_enabled (gdbarch, enabler.address)) return false; @@ -796,7 +796,7 @@ dtrace_probe::enable () /* Iterate over all defined enabler in the given probe and enable them all using the corresponding gdbarch hook. */ - for (const struct dtrace_probe_enabler &enabler : m_enablers) + for (const dtrace_probe_enabler &enabler : m_enablers) if (gdbarch_dtrace_enable_probe_p (gdbarch)) gdbarch_dtrace_enable_probe (gdbarch, enabler.address); } @@ -826,7 +826,7 @@ dtrace_probe::disable () /* Iterate over all defined enabler in the given probe and disable them all using the corresponding gdbarch hook. */ - for (struct dtrace_probe_enabler &enabler : m_enablers) + for (dtrace_probe_enabler &enabler : m_enablers) if (gdbarch_dtrace_disable_probe_p (gdbarch)) gdbarch_dtrace_disable_probe (gdbarch, enabler.address); } diff --git a/gdb/probe.c b/gdb/probe.c index 1be8faad35..e20bf31630 100644 --- a/gdb/probe.c +++ b/gdb/probe.c @@ -367,7 +367,7 @@ gen_ui_out_table_header_info (const std::vector &probes, std::vector headings = spops->gen_info_probes_table_header (); - for (const struct info_probe_column &column : headings) + for (const info_probe_column &column : headings) { size_t size_max = strlen (column.print_name); @@ -410,7 +410,7 @@ print_ui_out_not_applicables (const static_probe_ops *spops) std::vector headings = spops->gen_info_probes_table_header (); - for (const struct info_probe_column &column : headings) + for (const info_probe_column &column : headings) current_uiout->field_string (column.field_name, _("n/a")); }