From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5649 invoked by alias); 12 Nov 2014 15:26:57 -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 Received: (qmail 5597 invoked by uid 48); 12 Nov 2014 15:26:51 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/62184] [C/C++] Extend -Wempty-body to 'while' loops Date: Wed, 12 Nov 2014 15:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-11/txt/msg01003.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D62184 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-11-12 Ever confirmed|0 |1 --- Comment #4 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- I'm going to confirm this. We definitely want this. The heuristic of Clang seems quite elaborated: only warn when the ';' is on the same line and ther= e is a statement after it that starts at a higher column than the while.line. void foo () { #define EMPTY while (0)EMPTY; foo(); // warns if preprocessed while (0); foo(); // warns while (0); foo(); // does not warn while (0); // does not warn } $ clang test.c=20 test.c:6:12: warning: while loop has empty body [-Wempty-body] while (0); ^ test.c:6:12: note: put the semicolon on a separate line to silence this war= ning $ clang test.c -save-temps In file included from test.c:1: test.c:4:12: warning: while loop has empty body [-Wempty-body] while (0); ^ test.c:4:12: note: put the semicolon on a separate line to silence this war= ning test.c:6:12: warning: while loop has empty body [-Wempty-body] while (0); ^ test.c:6:12: note: put the semicolon on a separate line to silence this war= ning >>From gcc-bugs-return-466533-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Nov 12 15:29:36 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 10698 invoked by alias); 12 Nov 2014 15:29:36 -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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 10672 invoked by uid 48); 12 Nov 2014 15:29:32 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgcc/63832] [5.0 Regression] crtstuff.c:400:19: warning: array subscript is above array bounds [-Warray-bounds] Date: Wed, 12 Nov 2014 15:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgcc X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords target_milestone Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-11/txt/msg01005.txt.bz2 Content-length: 352 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63832 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Target Milestone|--- |5.0