libtool
[Top][All Lists]
Advanced

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

Re: Avoiding compiler warnings/errors with function pointers


From: Gary V. Vaughan
Subject: Re: Avoiding compiler warnings/errors with function pointers
Date: Tue, 5 Jun 2007 17:08:29 +0100

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 between function pointer and 'void *'

There's no problem with this on my machine with my compiler settings, but if I wanted to write strictly conforming ISO C it looks like I'd have a problem; equally if I wanted this code to run on a machine where void * was not compatible with a function pointer.

Is there some way to avoid this problem?

What type does dlsym() return on that system?

If it is a void*, then I don't know of any portable way around it :-(

Cheers,
        Gary
--
  ())_.              Email me: address@hidden
  ( '/           Read my blog: http://blog.azazil.net
  / )=         ...and my book: http://sources.redhat.com/autobook
`(_~)_ Join my AGLOCO Network: http://www.agloco.com/r/BBBS7912




Attachment: PGP.sig
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]