From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19846 invoked by alias); 4 Jul 2007 23:31:01 -0000 Received: (qmail 19813 invoked by uid 48); 4 Jul 2007 23:30:49 -0000 Date: Wed, 04 Jul 2007 23:31:00 -0000 Subject: [Bug c/32628] New: bogus integer overflow warning X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ak at muc dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-07/txt/msg00586.txt.bz2 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