When building libm-test.c (part of the GLIBC make check math test suite for
GLIBC CVS head as of April 10, 2008) with GCC 4.3 I get the following warning:
math/libm-test.c: In function 'parse_opt':
math/libm-test.c:6102: warning: array subscript is above array bounds
In relation to the following code:
if (strcmp (arg, "yes") == 0)
This warning goes away if replaced with:
char yes[] = "yes";
if (strcmp (arg,yes) == 0)
Andrew Pinski says this is a false warning and that I should file a bug report.
--
Summary: false warning when passing quoted string to function
strcmp(arg,"no");
Product: gcc
Version: 4.3.1
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rsa at us dot ibm dot com
GCC build triplet: n/a
GCC host triplet: n/a
GCC target triplet: n/a
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35903