This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/45464] New: Warning missing using -Wall when comparing unsigned int and sum of unsigned chars.
- From: "brutus at free dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Aug 2010 13:50:07 -0000
- Subject: [Bug c++/45464] New: Warning missing using -Wall when comparing unsigned int and sum of unsigned chars.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code will warn for line 6 but not for line 5, however, I
_think_the type of "a + a + a" is the same as the type of "a + a".
int main()
{
unsigned char a=0;
unsigned int b =0;
bool test1 =( b < a + a);//no warning, why
bool test2 =( b < a + a + a);//warning
if (wtf1 && wtf2) return 1;
}
--
Summary: Warning missing using -Wall when comparing unsigned int
and sum of unsigned chars.
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: brutus at free dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45464