On Wed 28 Mar 2007 (09:31 +0200), Christian Anthon wrote:
> Hi all,
>
> after some multidimensional arrays are declared const in function
> arguments I get compiler warnings on gcc/icc. I guess it boils down
> to:
>
> http://c-faq.com/ansi/constmismatch.html
>
> and then there is this icc warning as well:
>
> gtkwindows.c(122): warning #556: a value of type "void *" cannot be
> assigned to an entity of type "void (*)(GtkWidget *, void *)"
> cbData->DialogFun = (void*)okFun;
>
> the cast seems to work, but it is ugly.
It's wrong. Function pointers are not guaranteed to fit in oridinary
pointer types. The case should really be to a function pointer:
typedef void (*dialog_func_ty)(GtkWidget *, void*);
cbData->DialogFun = (dialog_func_ty) okFun;
Should compile without errors or warnings.