This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/52904] New: -Wstrict-overflow false alarm with bounded loop
- From: "eggert at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 08 Apr 2012 08:58:51 +0000
- Subject: [Bug c/52904] New: -Wstrict-overflow false alarm with bounded loop
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904
Bug #: 52904
Summary: -Wstrict-overflow false alarm with bounded loop
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: eggert@gnu.org
Created attachment 27113
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27113
simplified version of Emacs code, illustrating the bug
I ran into this problem when trying to build GNU Emacs with -Wstrict-overflow.
Compiling the attached program 'v.i' with the following command:
gcc -c -Wstrict-overflow -O2 v.i
generates the diagnostic:
v.i: In function 'wait_reading_process_output':
v.i:14:6: error: assuming signed overflow does not occur when simplifying
conditional to constant [-Werror=strict-overflow]
The diagnostic is obviously incorrect, since the variable 'nfds' cannot
possibly exceed 1024.
I will also attach the output of "gcc -v -c -Wstrict-overflow -O2 v.i".