From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15716 invoked by alias); 30 Apr 2014 16:35:05 -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 15616 invoked by uid 48); 30 Apr 2014 16:35:02 -0000 From: "alexfh at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/7652] -Wswitch-break : Warn if a switch case falls through Date: Wed, 30 Apr 2014 16:35: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: unknown X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: alexfh at google dot com 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: 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-04/txt/msg02293.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652 --- Comment #28 from Alexander Kornienko --- (In reply to Jonathan Wakely from comment #24) > (In reply to Matthew Woehlke from comment #22) > > [[gcc:fallthrough]] // suppress warning for fall-through to 'case C' > > N.B. the attribute-namespace for GNU extensions is "gnu" And also the attribute must be attached to a declaration or a statement. In Clang, the [[clang::fallthrough]] attribute is attached to an empty statement ';', so the syntax actually is: switch (x) { case 1: ... [[clang::fallthrough]]; // <- note the semicolon case 2: ...