This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54194] misleading suggestion about arithmetic in operand of '|'
- 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: Fri, 05 Oct 2012 16:26:22 +0000
- Subject: [Bug c++/54194] misleading suggestion about arithmetic in operand of '|'
- Auto-submitted: auto-generated
- References: <bug-54194-4@http.gcc.gnu.org/bugzilla/>
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.