This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/44077] New: -Wtype-limits fails to warn for _Bool comparisons
- From: "sirl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 May 2010 11:44:31 -0000
- Subject: [Bug c/44077] New: -Wtype-limits fails to warn for _Bool comparisons
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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