Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check compatibility options for using lua5.0 #25

Open
tilkinsc opened this issue Feb 21, 2019 · 2 comments
Open

Check compatibility options for using lua5.0 #25

tilkinsc opened this issue Feb 21, 2019 · 2 comments

Comments

@tilkinsc
Copy link
Owner

I would like to add Lua-5.0 to the build category listing.

I am not sure which functions I will have to remove (or add :o) in order to include it.

@tilkinsc
Copy link
Owner Author

tilkinsc commented Feb 26, 2021

Compatibility is a maybe due to functions being added which I use in later versions. By stripping features, I can implement LuaConsole to support earlier Lua versions. The code may result in being messy or I can figure out a clean way to do it. Whatever the case I will look into it.

@tilkinsc
Copy link
Owner Author

tilkinsc commented Feb 27, 2021

This is a capture of the errors and warnings that print out. It seems there are various function names that change. This isn't too surprising, as 5.0 and 5.1 aren't backwards compatible and shouldn't be expected to be. The same with previous versions and versions a set above that. However, it shouldn't break lua code at all. I think that is reserved for the first number as they follow this versioning: incompat.compat.patch where incompat breaks functionality between versions, compat alters functions but nothing should break, and patch are general purpose patches that don't alter much of anything.

Breakdown symbol -> suggestion : naming error, function may change, arguments may change

  • error_test_meta
    • luaL_typename -> lua_typename : name
  • load_parameters
    • lua_createtable -> lua_settable : name, function, arguments
    • lua_pushinteger -> lua_pushnumber : function
  • load_globals
    • lua_getfield -> lua_getfenv : name, function, arguments
    • lua_setfield -> lua_setfenv : name, function, arguments
  • luacon_loaddll
    • luaL_newstate -> lua_newtable : name, function, arguments
    • lua_gc -> lua_h : name, function, arguments
    • LUA_GCSTOP
    • luaL_openlibs -> luaL_openlib : name
    • LUA_GCRESTART
      note: each undeclared identifier is reported only once for each function it appears in
In file included from C:\git\LuaConsole\src\ldata.c:64:
C:\git\LuaConsole\src\consolew.h: In function 'error_test_meta':
C:\git\LuaConsole\src\consolew.h:204:16: warning: implicit declaration of function 'luaL_typename'; did you mean 'lua_typename'? [-Wimplicit-function-declaration]
  204 |    *out_type = luaL_typename(L, -1);
      |                ^~~~~~~~~~~~~
      |                lua_typename
C:\git\LuaConsole\src\consolew.h:204:14: warning: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  204 |    *out_type = luaL_typename(L, -1);
      |              ^
C:\git\LuaConsole\src\consolew.h: In function 'load_parameters':
C:\git\LuaConsole\src\consolew.h:270:2: warning: implicit declaration of function 'lua_createtable'; did you mean 'lua_settable'? [-Wimplicit-function-declaration]
  270 |  lua_createtable(L, 0, (int)ARGS.parameters);
      |  ^~~~~~~~~~~~~~~
      |  lua_settable
C:\git\LuaConsole\src\consolew.h:272:3: warning: implicit declaration of function 'lua_pushinteger'; did you mean 'lua_pushnumber'? [-Wimplicit-function-declaration]
  272 |   lua_pushinteger(L, i+1);
      |   ^~~~~~~~~~~~~~~
      |   lua_pushnumber
C:\git\LuaConsole\src\consolew.h: In function 'load_globals':
C:\git\LuaConsole\src\consolew.h:472:4: warning: implicit declaration of function 'lua_getfield'; did you mean 'lua_getfenv'? [-Wimplicit-function-declaration]
  472 |    lua_getfield(L, -1, cur_arg);
      |    ^~~~~~~~~~~~
      |    lua_getfenv
C:\git\LuaConsole\src\consolew.h:476:5: warning: implicit declaration of function 'lua_setfield'; did you mean 'lua_setfenv'? [-Wimplicit-function-declaration]
  476 |     lua_setfield(L, -2, cur_arg);
      |     ^~~~~~~~~~~~
      |     lua_setfenv
C:\git\LuaConsole\src\ldata.c: In function 'luacon_loaddll':
C:\git\LuaConsole\src\ldata.c:146:6: warning: implicit declaration of function 'luaL_newstate'; did you mean 'lua_newtable'? [-Wimplicit-function-declaration]
  146 |  L = luaL_newstate();
      |      ^~~~~~~~~~~~~
      |      lua_newtable
C:\git\LuaConsole\src\ldata.c:146:4: warning: assignment to 'lua_State *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  146 |  L = luaL_newstate();
      |    ^
C:\git\LuaConsole\src\ldata.c:157:3: warning: implicit declaration of function 'lua_gc'; did you mean 'lua_h'? [-Wimplicit-function-declaration]
  157 |   lua_gc(L, LUA_GCSTOP, 0);
      |   ^~~~~~
      |   lua_h
C:\git\LuaConsole\src\ldata.c:157:13: error: 'LUA_GCSTOP' undeclared (first use in this function)
  157 |   lua_gc(L, LUA_GCSTOP, 0);
      |             ^~~~~~~~~~
C:\git\LuaConsole\src\ldata.c:157:13: note: each undeclared identifier is reported only once for each function it appears in
C:\git\LuaConsole\src\ldata.c:158:3: warning: implicit declaration of function 'luaL_openlibs'; did you mean 'luaL_openlib'? [-Wimplicit-function-declaration]
  158 |   luaL_openlibs(L);
      |   ^~~~~~~~~~~~~
      |   luaL_openlib
C:\git\LuaConsole\src\ldata.c:159:13: error: 'LUA_GCRESTART' undeclared (first use in this function)
  159 |   lua_gc(L, LUA_GCRESTART, -1);
      |             ^~~~~~~~~~~~~
C:\git\LuaConsole\src\ldata.c:216:7: warning: assignment to 'lua_State *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  216 |    gL = luaL_newstate();
      |       ^
Linking luaw driver package liblclua-5.0.3.dll...
gcc: error: ldata.o: No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant