[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Warning with Lua 5.1.3 sources (gcc -pedantic)
- From: Tony Finch <dot@...>
- Date: Thu, 13 Mar 2008 13:00:07 +0000
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.
f.anthony.n.finch <email@example.com> 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.