lua-users home
lua-l archive

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


> 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);

Just to be sure, can you check whether the following also avoid the
warning? It is the same as yours, but using a typedef:

typedef void (*voidf)(void);

static lua_CFunction lsys_sym (lua_State *L, void *lib, const char *sym) {
  lua_CFunction f = (lua_CFunction)(voidf)GetProcAddress((HMODULE)lib, sym);
  if (f == NULL) pusherror(L);
  return f;
}

Many thanks,

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