constant signed/unsigned comparison warning
Per Bothner
bothner@cygnus.com
Wed Sep 24 12:42:00 GMT 1997
Instead of:
if (i == -1) {
...
}
else if (i < sizeof(foo)) {
...
}
what about:
if (i < 0) {
...
}
else if (i < sizeof(foo)) {
...
}
This is at least as clean, and this is something we *could* teach gcc
to recognize. (It would require some simple range analysis in Gcc,
but that is going to be very desirable anyway. Some support may
already have been added.)
--Per Bothner
Cygnus Solutions bothner@cygnus.com http://www.cygnus.com/~bothner
More information about the Gcc
mailing list