[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug in Lua when using signed long
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sun, 13 Dec 2009 13:01:46 -0200
> So you are saying that a configure script which sets up Lua before compiling
> the library and does not check that types are large enough to pass a
> standard type and retrieve the same type is not a bug?
Lua does not use a configure script. There is no automatic setup.
Lua uses a config header file that you're supposed to check and edit
to suit your platform. The relevant section in luaconf.h is
/*
@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger.
** CHANGE that if ptrdiff_t is not adequate on your machine. (On most
** machines, ptrdiff_t gives a good choice between int or long.)
*/
#define LUA_INTEGER ptrdiff_t
I guess the comment should make it clear that LUA_INTEGER should limit
integers to what can be stored without loss in a LUA_NUMBER.