This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/16502] inappropriate -Wunreachable-code warning from generic code
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jul 2004 22:02:06 -0000
- Subject: [Bug middle-end/16502] inappropriate -Wunreachable-code warning from generic code
- References: <20040712210704.16502.sebor@roguewave.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-12 22:02 -------
Fixed:
pr16502.cc: In function `void foo(T*) [with T = int]':
pr16502.cc:17: instantiated from here
pr16502.cc:9: warning: will never be executed
/export/gates/pinskia/openbsd/bin/../lib/gcc/i686-unknown-openbsd3.1/3.5.0/../../../../include/c+
+/3.5.0/new: In function `void* operator new(size_t, void*)':
/export/gates/pinskia/openbsd/bin/../lib/gcc/i686-unknown-openbsd3.1/3.5.0/../../../../include/c+
+/3.5.0/new:92: warning: will never be executed
now what is being warned abut is the throw() of the function is not ever going to happen which is true
and the catch cannot happen which is also true.
And if we look at the default placement defintion:
inline void* operator new(std::size_t, void* __p) throw() { return __p; }
this is right. Now -Wunreachable-code is correct, I would not use it all anyways because of all these
postives.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Component|c++ |middle-end
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16502