From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77154 invoked by alias); 2 May 2016 10:57:39 -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 77138 invoked by uid 89); 2 May 2016 10:57:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 02 May 2016 10:57:35 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 88F4D85364; Mon, 2 May 2016 10:57:34 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u42AvXrg024678; Mon, 2 May 2016 06:57:33 -0400 Subject: Re: [PATCH][gdb] Fix -Wparentheses warnings To: Kyrill Tkachov , gdb-patches@sourceware.org References: <57237D3A.2050203@foss.arm.com> From: Pedro Alves Message-ID: <55918437-8fb0-3d99-645a-667339829bc8@redhat.com> Date: Mon, 02 May 2016 10:57:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <57237D3A.2050203@foss.arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-05/txt/msg00003.txt.bz2 On 04/29/2016 04:26 PM, Kyrill Tkachov wrote: > Hi all, > > I recently moved to using GCC 6.1 and while building a toolchain for arm-none-eabi I got > > some -Werror=parentheses errors while building gdb. > > This patch fixes them. I think this is due to the way ALL_OBJSECTIONS is defined > > (due to using ALL_OBJFILE_OSECTIONS): > #define ALL_OBJFILE_OSECTIONS(objfile, osect) \ > for (osect = objfile->sections; osect < objfile->sections_end; osect++) \ > if (osect->the_bfd_section == NULL) \ > { \ > /* Nothing. */ \ > } \ > else > > > so that dangling 'else' probably causes the alarm in GCC. Bah. That's written that way exactly to avoid dangling if/else problems. I think it'd be reasonable for gcc to not warn when the if/else came from a macro, as users of the macro can't possibly be confused in the way the warning intents to help with. I'd call it a gcc regression. > > This patch fixes the -Werror errors for me and allows the build to finish successfully. > > > Is this ok to commit? OK. Thanks, Pedro Alves