From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15318 invoked by alias); 10 Apr 2008 18:44:25 -0000 Received: (qmail 15204 invoked by uid 48); 10 Apr 2008 18:43:41 -0000 Date: Thu, 10 Apr 2008 18:44:00 -0000 Subject: [Bug c/35903] New: false warning when passing quoted string to function strcmp(arg,"no"); X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rsa at us dot ibm dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg00798.txt.bz2 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