lua-users home
lua-l archive

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


On Wed, 12 Mar 2008, Asko Kauppi wrote:
>
>  lua_CFunction f = (lua_CFunction)dlsym(lib, sym);
>
> > loadlib.c: In function ‘ll_sym’:
> > loadlib.c:77: warning: ISO C forbids conversion of object pointer to
> > function pointer type

In this case the solution is to use dlfunc() instead, though not all
systems have extended the dynamic linker API this way.

The other point worth noting is that dlsym() is a POSIX function and POSIX
makes much stricter guarantees about the underlying machine architecture
than C does, so the warning doesn't matter on POSIX. However I agree that
warning cleanliness is something to aim for.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
SOLE: SOUTHWESTERLY BACKING EASTERLY FOR A TIME 4, INCREASING 5 TO 7. ROUGH OR
VERY ROUGH. RAIN OR SHOWERS. MODERATE OR GOOD, OCCASIONALLY POOR.