[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (rc2) now available
- From: Axel Kittenberger <axkibe@...>
- Date: Tue, 29 Nov 2011 13:24:11 +0100
I'd like the comma operator solution better, unless there is some
compiler that complains.
On Mon, Nov 28, 2011 at 8:28 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> > Would this trick satisfy all compilers?
>> >
>> > diff -r1.35 loslib.c
>> > 277c277,278
>> > < exit(status);
>> > ---
>> >> if (L) exit(status); /* test to avoid warnings of 'exit' x 'return' */
>> >> return 0;
>>
>> I think this would be foolproof:
>>
>> lua_pushnumber(L, 0);
>> if (lua_isnumber(L, -1)) exit(status);
>> return 0;
>
> Did you find a compiler that complained about the "if (L)" code?
>
> -- Roberto
>