bug-gnubg
[Top][All Lists]
Advanced

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

Re: [Bug-gnubg] icc/gcc Compiler warnings


From: Christian Anthon
Subject: Re: [Bug-gnubg] icc/gcc Compiler warnings
Date: Wed, 28 Mar 2007 18:08:22 +0200

On 3/28/07, Jim Segrave <address@hidden> wrote:
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.


It does. I'll give Jon a change to look at it before I check it in
though. I guess it is hes code.

Christian.




reply via email to

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