lua-users home
lua-l archive

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


> In a project I'm writing I want to ensure my C code doesn't use
> newfangled features, so I compile it with `-ansi` (or `-std=c90`). I'm
> using gcc.
> 
> However, in this mode the compiler emits an error:
> 
>     /usr/include/lua5.3/luaconf.h:573:2:
>     error: #error "Compiler does not support 'long long'. Use option
> '-DLUA_32BITS'
>     or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"
> 
> What should I do?
> 
> The Lua library on my system (liblua5.3.so) is precompiled with 64
> bits integers. I don't want to ship Lua together with my project. So I
> want Lua's header files to define integers as 64 bits (to match the
> installed Lua library). But if I add '-DLUA_32BITS' or
> '-DLUA_C89_NUMBERS' to my CFLAGS, as the error message advises,
> there'd be a mismatch between the Lua headers and my system's
> liblua5.3.so.

You may try the options '-ansi -Wno-long-long'. (It seems strange that a
'-W' affects definitions in the program, but it worked in my system.)

-- Roberto