This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/63510] New: Wrong line number in Wstrict-overflow message
- From: "ibuclaw at ubuntu dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 11 Oct 2014 07:12:31 +0000
- Subject: [Bug c/63510] New: Wrong line number in Wstrict-overflow message
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63510
Bug ID: 63510
Summary: Wrong line number in Wstrict-overflow message
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: ibuclaw at ubuntu dot com
Tested on gcc (GCC) 5.0.0 20140901 (experimental)
Building GDB fails with the following error - both of which show the wrong
line.
../../gdb/i387-tdep.c: In function âi387_supply_fsaveâ:
../../gdb/i387-tdep.c:447:1: error: assuming signed overflow does not occur
when assuming that (X + c) >= X is always true [-Werror=strict-overflow]
i387_supply_fsave (struct regcache *regcache, int regnum, const void *fsave)
^
../../gdb/i387-tdep.c: In function âi387_collect_fsaveâ:
../../gdb/i387-tdep.c:502:1: error: assuming signed overflow does not occur
when assuming that (X + c) >= X is always true [-Werror=strict-overflow]
i387_collect_fsave (const struct regcache *regcache, int regnum, void *fsave)
^
Reduced to the following code, which shows both the correct and wrong line.
gcc -O2 -Wall -Wextra -c i387-tdep.c
---
int st0_regnum;
void i387_supply_fsave ()
{
int i;
for (i = st0_regnum; i < st0_regnum + 16;)
{
}
}
---
i387-tdep.c: In function âi387_supply_fsaveâ:
i387-tdep.c:9:1: warning: assuming signed overflow does not occur when assuming
that (X + c) >= X is always true [-Wstrict-overflow]
}
^
i387-tdep.c:6:3: warning: assuming signed overflow does not occur when assuming
that (X + c) >= X is always true [-Wstrict-overflow]
for (i = st0_regnum; i < st0_regnum + 16;)
^