Mail Archives: djgpp/2003/02/10/07:30:13
ams AT ludd DOT luth DOT se wrote:
> Evidently the C idea of every pointer is compatible to "void *"
> doesn't extend to "void *"s in functions.
More precisely, it doesn't extend to function pointers. Pointers to
functions are quite strict in their compatibility requirements. It's
best to assume that you should never, ever, cast a function pointer,
or use a function pointer of a given type where a function pointer of
*any* other type is asked for.
> Alternatively is should be a safe to use strcmp directly (but don't
> hold me to this in court), so a functioncast (if possible) would make
> the compiler quiet.
That cast would be a placebo solution. It solves exactly none of the
problems that the language makers saw, and which made them require
this particular warning in the definition of standard C.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -