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 c/44077] New: -Wtype-limits fails to warn for _Bool comparisons


For the small testcase below gcc-4.4.3 neither warns about the initialization
of var1 nor about the comparison against an integer. Nevertheless the
comparison
is optimized away.

// gcc -O2 -Wtype-limits
_Bool var1 = 3;
int test(void)
{
  if (var1 == 3)
    return 1;
  return 0;
}

This maybe related to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34455


-- 
           Summary: -Wtype-limits fails to warn for _Bool comparisons
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sirl at gcc dot gnu dot org
 GCC build triplet: i686-redhat-linux
  GCC host triplet: i686-redhat-linux
GCC target triplet: i686-redhat-linux


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


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