This is the mail archive of the gcc-bugs@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]

[Bug other/29694] missed warnings about comparisons which are always true/false.



------- Comment #2 from pluto at agmk dot net  2006-11-03 10:44 -------
(In reply to comment #1)
> Adding -W/-Wextra and we get a warning:
> t.c: In function �foo�:
> t.c:3: warning: comparison of unsigned expression < 0 is always false
> t.c:5: warning: comparison of unsigned expression >= 0 is always true
> 
> 
> I always forget what -Wextra is for.

what about -Walways-true ?

<man>

-Walways-true

   Warn about comparisons which are always true such as testing if
   unsigned values are greater than or equal to zero. This warning
   is enabled by -Wall.

</man>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29694


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