This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/68007] New: False warning for integer overflow for unsigned integers
- From: "r.f.vannieuwpoort at student dot tudelft.nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 17 Oct 2015 21:06:38 +0000
- Subject: [Bug c/68007] New: False warning for integer overflow for unsigned integers
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68007
Bug ID: 68007
Summary: False warning for integer overflow for unsigned
integers
Product: gcc
Version: 4.8.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: r.f.vannieuwpoort at student dot tudelft.nl
Target Milestone: ---
The assignment of 0x7fffffff + 1 to a 32-bit unsigned integer causes a false
warning for an integer overflow (it would overflow if it was assigned to a
signed integer).
Example: uint32_t a = 0x7fffffff + 1
Compileable example:
#include <stdint.h>
int main(int argc, char *argv[])
{
uint32_t a = 0x7fffffff + 1;
return 0;
}