[PING] Walways-true:Warn if a comparison is always true or always false due to the limited range of the data type

Gabriel Dos Reis gdr@cs.tamu.edu
Wed Apr 4 14:49:00 GMT 2007


"Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:

| On 22/03/07, Dirk Mueller <dmueller@suse.de> wrote:
| > On Thursday, 22. March 2007, Manuel López-Ibáñez wrote:
| >
| > > I think that after 18 days, a ping is due.
| > > PING: http://gcc.gnu.org/ml/gcc-patches/2007-03/msg00207.html
| >
| > Again my usual comment: I think -Walways-true is a bad name for a warning that
| > warns about expressions being always false.
| >
| > I think -Wlogical or -Wlogical-invariant or similar would be a better name.
| >
| 
| I agree that it is a bad name but not because of the reason you point.
| I think it is bad because this warning should not try to warn about
| anything else than conditions that are always true (or false) because
| of the limited
| range of the data type. What you are trying to detect is whether you
| are using the wrong type in a comparison (or perhaps the wrong
| variable). In that context, Walways-true (and Wlogical) are too vague
| names but I prefer the former since Wlogical is even vaguer.
| 
| Alternative names:

  -Wtautology?
  -Wunsigned-rel?


Please, send me links to other patches I've not formally reviewed --
use my address at integrable-solutions.net; they have again messed up
mails here. :-(

-- Gaby



More information about the Gcc-patches mailing list