This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/32628] New: bogus integer overflow warning
- From: "ak at muc dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jul 2007 23:30:49 -0000
- Subject: [Bug c/32628] New: bogus integer overflow warning
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
gcc version 4.3.0 20070704 (experimental)
Following test case derived from the Linux ACPI code warns
toverflow.c: In function 'f':
toverflow.c:8: warning: integer overflow in expression
but the warning is not correct because 0 + ULONG_MAX doesn't really overflow.
typedef void *acpi_handle;
typedef unsigned long long UINT64;
typedef unsigned long long acpi_native_uint;
typedef unsigned char u8;
int f(acpi_handle device)
{
if (device == ((acpi_handle *) (void *) ((((u8 *) (void *) ((((void
*)0)))) + (acpi_native_uint)((UINT64)(~((UINT64) 0)))))))
return 1;
return 0;
}
--
Summary: bogus integer overflow warning
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ak at muc dot de
GCC build triplet: x86_64-linux
GCC host triplet: x86_64-linux
GCC target triplet: x86_64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32628