lua-users home
lua-l archive

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


Hi

At the moment I am testing Lua with two compilers: gcc and TinyCC (https://bellard.org/tcc/)

tcc bails out with "error: function pointer expected" on this line

#if defined(PTRDIFF_MAX) && (PTRDIFF_MAX < MAX_SIZE)


It tooks me a while to catch the root cause. In Lua file llimits.h there is

#define MAX_SIZE (sizeof(size_t) < sizeof(lua_Integer) ? MAX_SIZET : (size_t)(LUA_MAXINTEGER))


It seems to me C99 doesn't require support for "sizeof" in preprocessor conditionals.

BTW, tcc compiles fine if I replace that line with

#define MAX_SIZE LUA_MAXINTEGER


Best regards, M