[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Trouble running Lua script from C++ application
- From: "James Dennett" <james.dennett@...>
- Date: Fri, 27 Jun 2008 22:02:10 -0700
On Thu, Jun 26, 2008 at 11:59 AM, Cooper Clauson <ceclauson@hotmail.com> wrote:
>
> Thanks so much, that fixed the problem!
>
> I have no idea why the compiler didn't check that. I'm submitting a bug report about it.
Compilers normally don't check for missing return statements because
it's impossible to do in the general case.
Consider
int f() {
g();
}
in the case where g() never returns normally (i.e., it terminates
execution or throws an exception). Warning about f would be bad in
those cases, but failing to warn if g() ever does return is bad too,
and adding runtime checks is also bad (as it adds overhead).
-- James