add -Wlogical-op to standard compiler options?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: add -Wlogical-op to standard compiler options?
Date: 2012-11-15 06:17:10
Message-ID: 1352960230.19890.3.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I think it might be worth adding -Wlogical-op to the standard warning
options (for supported compilers, determined by configure test).

`-Wlogical-op'
Warn about suspicious uses of logical operators in expressions.
This includes using logical operators in contexts where a bit-wise
operator is likely to be expected.

In addition to what it says there, it appears to warn about illogical
combinations of < and >. I have been using it locally for a while
without problems. We have already found a couple of bugs this way.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Darren Duncan 2012-11-15 07:44:43 feature proposal - triggers by semantics
Previous Message Shigeru Hanada 2012-11-15 05:33:21 Re: Move postgresql_fdw_validator into dblink