[Openal-devel] FreeALUT dynamicly loading ogg/vorbis
Chris Robinson
chris.kcat at gmail.com
Tue Jun 10 20:57:29 PDT 2008
On Tuesday 10 June 2008 08:22:06 pm Sherief N. Farouk wrote:
> Well, according to the rationale section in this link:
> http://www.opengroup.org/onlinepubs/009695399/functions/dlsym.html , a
> void* to function* cast *IS* portable across POSIX systems, so I don't
> think you'll have a portability problem. Strict ANSI C compatibility
> though, I'm not sure. Maybe an early solution would've been to have a
> dlfn() that returns a "void (*) (void)", but I guess that's a bit too late
> ;).
Yeah, I'd imagine there wouldn't be a problem with portability. My main
problem is what to do with the warnings. If I do the casting in the example
in that page:
*(void **)(&fptr) = dlsym(handle, "my_function");
I get:
warning: dereferencing type-punned pointer will break strict-aliasing rules
which is actually more serious since breaking strict-aliasing rules can break
code, as opposed to just being told "ISO C doesn't like that".
The only thing I can think of to clear the warnings is to remove the
ansi/pedantic flags, but I'm not sure if that's acceptable.
More information about the Openal-devel
mailing list