From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18718 invoked by alias); 23 Feb 2011 23:36:14 -0000 Received: (qmail 18623 invoked by uid 22791); 23 Feb 2011 23:36:13 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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, 23 Feb 2011 23:36:09 +0000 From: "ami at fischman dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/20681] [4.3/4.4/4.5/4.6 Regression] wrong "control reaches" warning with switches X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: minor X-Bugzilla-Who: ami at fischman dot org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.3.6 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: Thu, 24 Feb 2011 00:59: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-02/txt/msg02709.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D20681 --- Comment #29 from Ami Fischman 2011-02-23 23:3= 5:45 UTC --- Further reduced test case from dup bug 47864: $ nl t.cc ; g++ -finstrument-functions -Wreturn-type -Werror -c t.cc 1 int foo(int type) { 2 switch(type) { 3 case 0: return 1; break; 4 default: return 0; 5 } 6 } cc1plus: warnings being treated as errors t.cc: In function =E2=80=98int foo(int)=E2=80=99: t.cc:6: error: control reaches end of non-void function (in 4.4.3)