Re: Avoiding compiler warnings/errors with function pointers

2007-06-11 Thread Peter O'Gorman
On Jun 11, 2007, at 12:34 PM, Reuben Thomas wrote: On Tue, 5 Jun 2007, Peter O'Gorman wrote: freeBSD has a dlfunc() function that behaves like dlsym but returns a function pointer, last time I looked it was implemented using a union... wait, let me look again...: http://www.freebsd.org/cgi

Re: Avoiding compiler warnings/errors with function pointers

2007-06-11 Thread Reuben Thomas
On Tue, 5 Jun 2007, Peter O'Gorman wrote: freeBSD has a dlfunc() function that behaves like dlsym but returns a function pointer, last time I looked it was implemented using a union... wait, let me look again...: http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/lib/libc/gen/dlfunc.c?rev=1.3;

Re: Avoiding compiler warnings/errors with function pointers

2007-06-05 Thread Peter O'Gorman
On Tue, 2007-06-05 at 17:08 +0100, Gary V. Vaughan wrote: > He Reuben, > > On 4 Jun 2007, at 09:55, Reuben Thomas wrote: > > I have a line of code like this: > > > >if ((l_fn = lt_dlsym(l_st->lth, "ladspa_descriptor")) == NULL) { > > > > where l_fn is a function pointer. gcc says: > > > > lads

Re: Avoiding compiler warnings/errors with function pointers

2007-06-05 Thread Gary V. Vaughan
He Reuben, On 4 Jun 2007, at 09:55, Reuben Thomas wrote: I have a line of code like this: if ((l_fn = lt_dlsym(l_st->lth, "ladspa_descriptor")) == NULL) { where l_fn is a function pointer. gcc says: ladspa.c: In function 'sox_ladspa_getopts': ladspa.c:114: warning: ISO C forbids assignment

Avoiding compiler warnings/errors with function pointers

2007-06-05 Thread Reuben Thomas
I have a line of code like this: if ((l_fn = lt_dlsym(l_st->lth, "ladspa_descriptor")) == NULL) { where l_fn is a function pointer. gcc says: ladspa.c: In function 'sox_ladspa_getopts': ladspa.c:114: warning: ISO C forbids assignment between function pointer and 'void *' There's no problem