[Bug 358374] [NEW] irritating bogus warnings on strcmp
Thorsten Glaser
t.glaser at tarent.de
Thu Apr 9 11:14:40 UTC 2009
Public bug reported:
Binary package hint: gcc-snapshot
Bug in gcc-snapshot-20090327-0ubuntu1
=== test programme ===
tglase at tglase:~$ cat t.c
#include <string.h>
int
testfunc(const char **wp)
{
int argc;
for (argc = 0; wp[argc]; argc++)
;
if (strcmp(wp[0], "[") == 0) {
if (strcmp(wp[--argc], "]") != 0) {
return (1);
}
return (2);
}
return (3);
}
=== old vs. new gcc ===
tglase at tglase:~$ cc -Wall -g -O2 -fno-strict-aliasing -fstack-protector-
all -fwrapv -std=gnu99 -c t.c
tglase at tglase:~$ /usr/lib/gcc-snapshot/bin/gcc -Wall -g -O2 -fno-strict-aliasing -fstack-protector-all -fwrapv -std=gnu99 -c t.c
t.c: In function 'testfunc':
t.c:11: warning: offset '3' outside bounds of constant string
t.c:12: warning: offset '3' outside bounds of constant string
=== environment ===
• jaunty schroot
tglase at tglase:~$ dpkg -l gcc gcc-snapshot
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=====================-=====================-==========================================================
ii gcc 4:4.3.3-1ubuntu1 The GNU C compiler
ii gcc-snapshot 20090327-0ubuntu1 A SNAPSHOT of the GNU Compiler Collection
** Affects: gcc-snapshot (Ubuntu)
Importance: Undecided
Status: New
--
irritating bogus warnings on strcmp
https://bugs.launchpad.net/bugs/358374
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
More information about the universe-bugs
mailing list