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

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed May 4 18:35:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70922

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #11 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Pedro Alves from comment #8)
> Because this would do the wrong thing:
> 
>   if (condition)
>     ALL_OBJFILE_OSECTIONS (o, osect)
>   else
>     return 0;
> 
> 
> But not this:
> 
> #define ALL_OBJFILE_OSECTIONS(objfile, osect)	\
>   for (osect = sections; osect < sections_end; osect++) \
>     if (osect->the_bfd_section != 0)					\
>       {									\
> 	/* Nothing.  */							\
>       }									\
>     else

??? That would expand to 

}
else
else
   return 0;


More information about the Gcc-bugs mailing list