public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/43772]  New: Errant -Wlogical-op warning when testing limits
@ 2010-04-16 21:44 P at draigBrady dot com
  2010-04-17 11:03 ` [Bug c/43772] " rguenth at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: P at draigBrady dot com @ 2010-04-16 21:44 UTC (permalink / raw)
  To: gcc-bugs

/* compile with: gcc -Werror -Wlogical-op */

#include <limits.h>

# define BOT INT_MIN
# define TOP INT_MAX

int main(void)
{
  int i=42;
  i = (i >  BOT   && i <  TOP);   //OK
  i = (i >= BOT+1 && i <= TOP-1); //OK
  i = (i >= BOT   && i <= TOP);   //Oops!
}


-- 
           Summary: Errant -Wlogical-op warning when testing limits
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: P at draigBrady dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-06-10 23:19 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-43772-4@http.gcc.gnu.org/bugzilla/>
2011-06-15 19:20 ` [Bug c/43772] Errant -Wlogical-op warning when testing limits eggert at gnu dot org
2011-07-15  3:02 ` eggert at gnu dot org
2012-04-28 12:20 ` marc.glisse at normalesup dot org
2012-04-28 12:33 ` manu at gcc dot gnu.org
2012-04-28 12:34 ` marc.glisse at normalesup dot org
2012-04-28 12:38 ` manu at gcc dot gnu.org
2012-04-28 12:40 ` marc.glisse at normalesup dot org
2012-04-28 12:50 ` manu at gcc dot gnu.org
2012-04-28 12:56 ` marc.glisse at normalesup dot org
2012-04-28 13:08 ` manu at gcc dot gnu.org
2012-04-28 18:50 ` marc.glisse at normalesup dot org
2012-04-28 21:53 ` eggert at gnu dot org
2012-04-28 22:17 ` marc.glisse at normalesup dot org
2012-04-28 22:41 ` eggert at gnu dot org
2012-05-05 11:32 ` manu at gcc dot gnu.org
2012-05-05 12:15 ` manu at gcc dot gnu.org
2014-06-10 23:19 ` P at draigBrady dot com
2010-04-16 21:44 [Bug c/43772] New: " P at draigBrady dot com
2010-04-17 11:03 ` [Bug c/43772] " rguenth at gcc dot gnu dot org
2010-04-17 17:41 ` P at draigBrady dot com
2010-04-22  0:38 ` P at draigBrady dot com
2010-09-23  6:52 ` muntyan at fastmail dot fm
2010-09-23  8:13 ` manu at gcc dot gnu dot org
2010-09-23  8:24 ` manu at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).