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++/54194] misleading suggestion about arithmetic in operand of '|'


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54194

--- Comment #4 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-10-05 16:26:22 UTC ---
Using warning_at is an improvement, yes.

It still doesn't clarify where the parentheses should go, or why the
parentheses are suggested. This is why clang changed the text of the warning. I
seem to remember this as an example of cryptic diagnostic from GCC in some
Clang presentation. Perhaps the massive takedown by Carruth at GoingNative2012
? Bah, I am not going to watch that again just to check.

I personally, find the "& within |" message quite cryptic. My suggestion would
be something like:

warning: precedence of '&' within '|' may be confusing without parentheses
note: if correct, place parentheses around '&' expression to silence this
warning

The warning could point to '|', the note could point to '&'. Alternatively,
there may be a way to say everything in an even shorter line.


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