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 #17 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
(In reply to Pedro Alves from comment #16)
> 
> This could also be sorted out with indentation level tracking -- the if
> binds to the else in the macro, but it is not indented as one would expect
> if it was meant to.

What should the indentation track? The start of the macro? Or should it look
within the macro?

I can imagine that if the 'else' is within a macro, and we are going to warn,
then only warn if the column of the 'if' is <= the column of the macro
expansion point. In principle, this should not trigger any new false positives,
since we only restrict the warning. But who knows, real code is sometimes
weird.

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