[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Avoiding compiler warnings/errors with function pointers
From: |
Reuben Thomas |
Subject: |
Avoiding compiler warnings/errors with function pointers |
Date: |
Mon, 4 Jun 2007 10:55:06 +0200 (CEST) |
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?
--
http://rrt.sc3d.org/ | resident, a. unable to leave (Bierce)
- Avoiding compiler warnings/errors with function pointers,
Reuben Thomas <=