From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5998 invoked by alias); 19 Mar 2007 23:19:05 -0000 Received: (qmail 5948 invoked by uid 48); 19 Mar 2007 23:18:54 -0000 Date: Mon, 19 Mar 2007 23:19:00 -0000 Message-ID: <20070319231854.5947.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/31246] Strange -Wunreachable-code warning with _GLIBCXX_DEBUG In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" 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: 2007-03/txt/msg01873.txt.bz2 ------- Comment #14 from pinskia at gcc dot gnu dot org 2007-03-19 23:18 ------- But the user can see the code, it is what is produced by what the C++ standard says is produced, now you could say the user has no control over fixing it, it is also true with the template case. Both cases are hard to fix without much thought. There is also something like: static inline int f(int a) { if (a) return g(); return 0; } int h(void) { return f(0); } With -Wunreachable-code -O1, we warn that we cannot reach the line containing return g(); Now should we, it is the same case, how can an user fix that code if the static inline function comes in from a header, they cannot. -Wunreachable-code warning is useless except if you want to see if you do coverage. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31246