Re: ?? warning: ANSI C++ forbids implicit conversion from `void *' in initialization ???



On 14 Feb 2002 14:49:28 +0100
Sven Neumann <sven gimp org> wrote:

> > Summary:
> > GTK has an poor/incorrect definition of NULL that breaks C++ code.  At a
> > minimum, the definition should be fixed.  However, the better fix would be
> > to simply remove the definition, and use the one provided by the compiler.
> 
> here's how glib-2.0 defines NULL:
> 
>   /* We include stddef.h to get the system's definition of NULL
>    */
>   #include <stddef.h>

[ snip ]

That looks better!  That (critical) #include isn't in v1.2, meaning that
(C++) must ensure they #include <stddef.h> explicitely themselves before
#including any GTK header files (Very tedious and error prone...)

[ Sorry, I guess I should have clarified that I was referring to GTK 1.2.
I haven't had time to look at 1.3/2.0 yet... ]

If that little change could be back-ported to v1.2 (hint, hint!), I think
(C++) users might be happier... ;-)
(After all, v1.2 is still the defacto, stable, standard version.  v2.0 may
be coming Real Soon, but I suspect v1.2 will still be around for awhile...)

Ian



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