From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23152 invoked by alias); 17 Mar 2007 17:27:01 -0000 Received: (qmail 23117 invoked by uid 48); 17 Mar 2007 17:26:48 -0000 Date: Sat, 17 Mar 2007 17:27:00 -0000 Message-ID: <20070317172648.23116.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/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: "sylvain dot pion at sophia dot inria dot fr" 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/msg01675.txt.bz2 ------- Comment #2 from sylvain dot pion at sophia dot inria dot fr 2007-03-17 17:26 ------- Trying further, I noticed that simply default constructing an std::vector, even without the debug mode _GLIBCXX_DEBUG, generates also a bunch (14 !) of these warnings. Andrew, I did not follow all the details of your explanation. I don't understand if there is finally a problem with the libstdc++ code or not. And if there is, what should be done. Is this a warning meant to be useful at all, or meant for GCC developers? How do we get rid of this warning for the simplest C++ code I showed? Other compilers are able to warn for unreachable code in better conditions. for example, they warn for "int f() { return 1 ; return -1; }", and I was trying to see if GCC was able to generate the same kind of warnings. I only found -Wunreachable-code, but so far it proves unusable for C++. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31246