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.

Reply via email to