lua-users home
lua-l archive

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


> I have a line of code in my Lua module source which looks like this:
> 
>  luaL_newlib(L, functions);
> 
> 'functions' is of type 'const luaL_Reg *'
> 
> The module compiles fine, but issues a warning:
> 
> ‘implicit conversion from 'unsigned long' to 'int' changes value from
> 18446744073709551615 to -1’.
> 
> It doesnt appear to be happening anywhere in my code. How do I make
> this go away?
> 
> Full output is below:
> 
> src/luaharfbuzz/class_utils.c:12:3: warning: implicit conversion from
> 'unsigned long' to
>       'int' changes value from 18446744073709551615 to -1
> [-Wconstant-conversion]
>   luaL_newlib(L, functions);
>   ^~~~~~~~~~~~~~~~~~~~~~~~~
> /Users/deepak/.lua/include/lauxlib.h:112:26: note: expanded from macro
> 'luaL_newlib'
>   (luaL_checkversion(L), luaL_newlibtable(L,l), luaL_setfuncs(L,l,0))
>                          ^~~~~~~~~~~~~~~~~~~~~
> /Users/deepak/.lua/include/lauxlib.h:109:50: note: expanded from macro
>       'luaL_newlibtable'
>   lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1)
>   ~~~~~~~~~~~~~~~       ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
> 1 warning generated.

Exactly how 'functions' is defined?

-- Roberto