This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35547] New: -Wparentheses not useful in its current form
- From: "duz at sol-3 dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2008 08:11:03 -0000
- Subject: [Bug c/35547] New: -Wparentheses not useful in its current form
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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