lua-users home
lua-l archive

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


> I built it in x86_64-w64-mingw32 , gcc version 8.2.0 (Rev1, Built by
> MSYS2 project), it reports a warning :
> 
> loadlib.c:209:21: warning: cast between incompatible function types
> from 'FARPROC' {aka 'long long int (*)()'} to 'int (*)(lua_State *)'
> {aka 'int (*)(struct lua_State *)'} [-Wcast-function-type]
>    lua_CFunction f = (lua_CFunction)GetProcAddress((HMODULE)lib, sym);
>                                 ^
> 
> I guess we can cast it to `cast first to void (*)(void)` first to fix it,
> 
>   lua_CFunction f = (lua_CFunction)(void
> (*)(void))GetProcAddress((HMODULE)lib, sym);
> 
> It looks ugly, but it works.

Do other Windows enthusiasts have something to say about that? In
particular, to do that, wouldn't be better 'void(*)()' instead of
'void(*)(void)'?

-- Roberto
_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org