add -Wlogical-op to standard compiler options? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject add -Wlogical-op to standard compiler options?
Date
Msg-id 1352960230.19890.3.camel@vanquo.pezone.net
Whole thread Raw
Responses Re: add -Wlogical-op to standard compiler options?  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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
operatorsin 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.




pgsql-hackers by date:

Previous
From: Shigeru Hanada
Date:
Subject: Re: Move postgresql_fdw_validator into dblink
Next
From: Darren Duncan
Date:
Subject: feature proposal - triggers by semantics