This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: bad inlining
- To: Alan Lehotsky <lehotsky at tiac dot net>
- Subject: Re: bad inlining
- From: Todd Vierling <tv at pobox dot com>
- Date: Wed, 22 Jul 1998 09:19:42 -0400 (EDT)
- cc: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>, parkes at sierravista dot com, egcs-bugs at cygnus dot com
On Thu, 16 Jul 1998, Alan Lehotsky wrote:
: * If you compile with -Wall, g++ will warn in some cases.
^^^^^^^^^^
: While the general phrase "...halting problem" is true, I don't believe
: that it is accurate. You can't determine IF the function will EVER
: return (in general). However, you are able to determine if there
: is a path leading to the function's exit(s) that doesn't return a value.
gcc actually has an extension for this: if you use
__attribute__((noreturn)) it won't warn for this. Among others, NetBSD's
definition for exit() has this, and as such, functions which call exit() as
their last breath won't hit the warning. (Under GNU C, you can use the
"volatile" keyword on a function to do the same effect.)
--
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)