From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6139 invoked by alias); 2 Mar 2011 15:17:52 -0000 Received: (qmail 6130 invoked by uid 22791); 2 Mar 2011 15:17:51 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Mar 2011 15:17:48 +0000 From: "vincent at vinc17 dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/36299] spurious and undocumented warning with -Waddress for a == 0 when a is an array X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vincent at vinc17 dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Wed, 02 Mar 2011 15:17:00 -0000 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: 2011-03/txt/msg00192.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D36299 --- Comment #9 from Vincent Lef=C3=A8vre 2011-0= 3-02 15:17:33 UTC --- (In reply to comment #8) > Every warning warns about something valid in C, otherwise it would be an = error > not a warning. No, for instance: int main(void) { int i; return i; } This is undefined behavior and detected by GCC, but one gets only a warning: tst.c: In function =E2=80=98main=E2=80=99: tst.c:4: warning: =E2=80=98i=E2=80=99 is used uninitialized in this function Compare to a =3D=3D 0 in the above testcase, which has a well-defined behav= ior.