This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70922] -Wparentheses warning should not complain about if-else from macro expansion


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]