This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: bad inlining
>>>>> «Alan», Alan Lehotsky <lehotsky@tiac.net> wrote:
Alan> At 9:11 AM +0200 7/16/98, Martin von Loewis wrote:
Alan> * > But isn't it a fatal error for a function not to return a value in C++?
Alan> *
Alan> * No, it is undefined behaviour. In general, determining whether a
Alan> * function returns a value under all conditions is equivalent to the
Alan> * halting problem. If you compile with -Wall, g++ will warn in some
Alan> * cases.
Alan> *
Alan> * Martin
Alan> While the general phrase "...halting problem" is true, I don't believe
Alan> that it is accurate. You can't determine IF the function will EVER
Alan> return (in general). However, you are able to determine if there
Alan> is a path leading to the function's exit(s) that doesn't return a value.
Alan> AND, for the C programming language, and for the GCC RTL it should be
Alan> straightforward to discover that SOME path leading to the return doesn't
Alan> return a value.
You didn't mention C++. How about function which throws exceptions ?
-- Gaby