This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -Wparentheses lumps too much together


Andreas Schwab wrote:
Ian Lance Taylor <iant@google.com> writes:

I'm inclined to approve this if -Wprecedence stays in -Wall, but I'd
like to hear if anybody else has anything to say.

The name of the option is rather poor, IMHO. -Wparentheses warns about precedences, so what is the difference to -Wprecedence?

-Wparentheses warns in general about things that the GCS prefer to be parenthesized. I would prefer something like


int warn_precedence = 2;

...

if (warn_precedence == 2)
  warn_precedence = warn_parentheses;

that is, we have

  -Wparentheses remains as is now, and is enabled by -Wall
  -Wparentheses -Wno-precedence only warns about things like a = b = c
                                for bool b and non-bool a

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]