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: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 May 2016 19:42:37 +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 #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.