This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/38370] New: inconsistent warnings
- From: "doko at ubuntu dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Dec 2008 10:24:36 -0000
- Subject: [Bug other/38370] New: inconsistent warnings
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
[forwarded from https://launchpad.net/bugs/291780]
When compiling a small test program, the compiler shows a warning I would
either not expect at all, or expect it to appear for all four if-statements
used in my example:
$ gcc -Wextra -c promotion.c
promotion.c: In function ?main?:
promotion.c:10: warning: comparison of promoted ~unsigned with unsigned
promotion.c:
typedef unsigned char uint8_t;
int main(void)
{
uint8_t a = 0;
uint8_t b = 0;
unsigned char c = 0;
unsigned char d = 0;
if (a == (b ^ 0xff)) { }
if (a == (d ^ 0xff)) { }
if (c == (b ^ 0xff)) { }
if (c == (d ^ 0xff)) { }
return 0;
}
--
Summary: inconsistent warnings
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: doko at ubuntu dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38370