This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bad inlining


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)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]