This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/46742] -Wparentheses unexpectedly misses some cases
- From: "sirl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 17 Jul 2017 15:38:46 +0000
- Subject: [Bug c/46742] -Wparentheses unexpectedly misses some cases
- Auto-submitted: auto-generated
- References: <bug-46742-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46742
--- Comment #5 from Franz Sirl <sirl at gcc dot gnu.org> ---
Actually, after seeing a large bunch of justified warnings in our codebase with
the disabled APPEARS_TO_BE_BOOLEAN_EXPR_P check, I wonder if a new option like
-Wbool-bitwise-parentheses (thus not depending on the logical NOT) would make
sense?
Note that this is heavily influenced by my code reading/code debugging POV, I
really hate it if I need lots of context to decide whether a statement in a
codebase unknown to me is correct or not. A warning like
-Wbool-bitwise-parentheses encourages programmers to make their intention clear
from the start. Or, in the best case, even uncovers coding bugs or typos early.