Re: Warning with Lua 5.1.3 sources (gcc -pedantic)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Warning with Lua 5.1.3 sources (gcc -pedantic)
- From: Tony Finch <dot@...>
- Date: 2008年3月13日 13:00:07 +0000
On 2008年3月12日, 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.