Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb] Fix -Wparentheses warnings
Date: Mon, 02 May 2016 10:57:00 -0000	[thread overview]
Message-ID: <55918437-8fb0-3d99-645a-667339829bc8@redhat.com> (raw)
In-Reply-To: <57237D3A.2050203@foss.arm.com>

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


  reply	other threads:[~2016-05-02 10:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29 15:27 Kyrill Tkachov
2016-05-02 10:57 ` Pedro Alves [this message]
2016-05-02 17:03   ` Pedro Alves
2016-05-03  9:01     ` Kyrill Tkachov
2016-05-03 10:03       ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55918437-8fb0-3d99-645a-667339829bc8@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kyrylo.tkachov@foss.arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox