lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 12/21/2012 09:44 AM, Philipp Kraus wrote:
> 
> Am 21.12.2012 um 15:25 schrieb Peter Cawley:
> 
>> If you compile Lua as C, then it'll use setjmp/longjmp, and you don't get stack unwinding.
>> If you compile Lua as C++, then it'll use exceptions, and you do get stack unwinding.
> 
> Nice to know. How I do this compiler option? Should I setup any preprocessing flags or
> should I use a C++ / C compiler only

I believe that C++ exceptions are used for error() by default if the Lua
runtime was compiled with a C++ compiler (not just your C++ functions, but
the Lua distribution); otherwise, if Lua was compiled with a C compiler it
will use setjmp()/longjmp() even if you are using a C++ compiler.

You might want to have a look at:
http://lua-users.org/lists/lua-l/2012-11/msg00509.html

-- David