lua-users home
lua-l archive

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

  We only moved the "typedef" to lua.h, which is included in lstate.h.
So, now the relevant parts read as:

> /* included from lua.h */
> typedef struct lua_State lua_State;
> extern lua_State *lua_state;
> /* in lstate.h */
> struct lua_State {
>    ...
> };
> extern lua_State *lua_state;

(There are two declarations of "lua_state"; the last one is unecessary, but
causes no harm.)  So, the 'type' "lua_State" is already declared (by the
typedef) when the extern declaration appears. This is ANSI C, and compiles
without warnings in all compilers we know about, except an old Borland C.
(That compiler complains about declaring a pointer to a struct when the
struct itself is not defined. So, if you include only lua.h, it will complain
that "lua_state" points to an undefined struct. This old Borland is the
only compiler we know that has this problem, and it's its problem, since
ANSI allows such definitions.)

  It is strange that you are having problems with gcc. Gcc its our main
compiler, and Lua compiles in gcc without warnings, even with options
"-Wall -ansi -pedantic".

-- Roberto