[Bug c/35547] New: -Wparentheses not useful in its current form
duz at sol-3 dot de
gcc-bugzilla@gcc.gnu.org
Wed Mar 12 08:11:00 GMT 2008
The new warnings about parentheses suggested around &&
inside || and things like that are annoying. For me, and
I assume for many other programmers, these are as natural
as that * is stronger than +.
So I will definitely not litter my code with parentheses
to make GCC happy about this. Rather I'd disable that
warning. But that would also disable the assignment
in if() warning, which is a different thing and useful.
So my suggestion would be to split -Wparentheses
into three warning options (at least) as follows:
-Wtruth-assignment warns about if (a=b)
-Wdangling-else warns about if (a) if (b) else ...
-Woperator-precedence warns about a && b || c
I checked the source, this seems trivial to change.
It is more a politcal issue. So what are the opinions on it?
--
Summary: -Wparentheses not useful in its current form
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: duz at sol-3 dot de
GCC build triplet: any
GCC host triplet: any
GCC target triplet: any
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35547
More information about the Gcc-bugs
mailing list