This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35547] -Wparentheses not useful in its current form
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2008 18:38:52 -0000
- Subject: [Bug c/35547] -Wparentheses not useful in its current form
- References: <bug-35547-5925@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from joseph at codesourcery dot com 2008-03-12 18:38 -------
Subject: Re: -Wparentheses not useful in its current form
On Wed, 12 Mar 2008, manu at gcc dot gnu dot org wrote:
> My opinion is that since -Wparentheses appears in released versions, we should
> keep its behaviour as much as possible, even if the name could have been
> better. However, since many users are complaining about the precedence
> warnings, I agree it would be nice to move them out of -Wparentheses and into
> -Wprecedence, as proposed by Doug. I think this also should go into 4.3.1,
> since the new warnings were introduced in 4.3.0 and the change is quite safe.
The only thing documented in the release notes as new in 4.3.0 in this
regard is that -Wparentheses works for C++ as it did for C. I consider
this a bug fix and don't think moving things out for one language only
would be appropriate; instead, new options should be added in 4.4 and
-Wparentheses and -Wall made to enable all the new options.
The question is not just whether the code writer knows the precedence
issues, the option is also there to enforce a particular coding style to
help code readers as well. See the statistics on developer understanding
of precedence that Derek Jones posted:
http://gcc.gnu.org/ml/gcc/2008-03/msg00486.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35547