This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70922] -Wparentheses warning should not complain about if-else from macro expansion
- From: "palves at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 May 2016 18:41:21 +0000
- Subject: [Bug c++/70922] -Wparentheses warning should not complain about if-else from macro expansion
- Auto-submitted: auto-generated
- References: <bug-70922-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70922
--- Comment #13 from Pedro Alves <palves at redhat dot com> ---
Should have been:
if (condition)
ALL_OBJFILE_OSECTIONS (o, osect)
{
/* do something with each o / osect */
}
else
return 0;
So if the ALL_OBJFILE_OSECTIONS macro contains an imbalanced if/else then the
"else" above binds to the wrong "if". But not if the macro contains a balanced
if/else, such as in the original code.