public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35903]  New: false warning when passing quoted string to function strcmp(arg,"no");
@ 2008-04-10 18:44 rsa at us dot ibm dot com
  2008-04-10 18:58 ` [Bug c/35903] " rsa at us dot ibm dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: rsa at us dot ibm dot com @ 2008-04-10 18:44 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-02-20  0:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-10 18:44 [Bug c/35903] New: false warning when passing quoted string to function strcmp(arg,"no"); rsa at us dot ibm dot com
2008-04-10 18:58 ` [Bug c/35903] " rsa at us dot ibm dot com
2008-04-10 18:59 ` rsa at us dot ibm dot com
2009-10-16 16:51 ` [Bug middle-end/35903] " cepeda at gmail dot com
2009-10-17 11:03 ` manu at gcc dot gnu dot org
2009-10-22 17:56 ` manu at gcc dot gnu dot org
2009-10-22 18:30 ` cepeda at gmail dot com
2009-10-22 18:32 ` cepeda at gmail dot com
2010-01-02 19:24 ` [Bug middle-end/35903] false uninitialized " rguenth at gcc dot gnu dot org
2010-02-19 23:56 ` [Bug middle-end/35903] false Warray-bounds " manu at gcc dot gnu dot org
2010-02-20  0:19 ` manu at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).