[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Lua 5.2.0 (rc2) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 28 Nov 2011 15:51:11 -0200
> Roberto Ierusalimschy <email@example.com> wrote:
> > 277c277
> > < exit(status);
> > ---
> > > return (exit(status), 0);
> That's an error because exit() doesn't return a value :-)
> I think in this case the compiler is wrong to produce the warning. Good
> implementations have an annotation on exit() to say it never returns.
> This is not a bug in Lua.
The problem here is that this kind of annotation is not ANSI. So, some
compilers have the annotation and rightfully complain when there is a
return, and some do not have the annotation and rightfully (for their
knowledge) complain when there is no return.
Would this trick satisfy all compilers?
diff -r1.35 loslib.c
> if (L) exit(status); /* test to avoid warnings of 'exit' x 'return' */
> return 0;