GCC 2.95 & GNOME Apps



Under the recently released GCC 2.95 (using g++) this code:

GnomeUIInfo info =
{
    GNOME_APP_UI_ITEM, N_("_New game"), N_("Create a new game"),
    onMenuFile, reinterpret_cast<gpointer>(0), null,
    GNOME_APP_PIXMAP_STOCK,
    GNOME_STOCK_MENU_NEW, // ERROR
    'n', GDK_CONTROL_MASK, null
};

now yields this error:

initialization to `void *' from `const char *' discards qualifiers

This is because GNOME_STOCK_MENU_NEW is a macro define for a "string"
literal, which is const, and is being used to initialize a void*.

Notwithstanding complaints of bad design and programming style, to fix
this I have to perform a const_cast:

    const_cast<char*>(GNOME_STOCK_MENU_NEW), // OK

I also now have problems with the prototype for destroy callbacks being
untyped:

void (*)(...)

Notwithstanding complaints of bad design and programming style, this
suppression of the compiler's type system now causes some of my
overloaded functions to choke. To fix this, I had to change the names of
some of them.

I suppose my question is: will GNOME ever be type safe and sound? Are
there any other GCC 2.95 pitfalls I should be aware of?

-- 
SEGV  -  http://www.cgocable.net/~mlepage/
Features Minion real-time strategy game, RTS game programming info,
GTK+ tutorial, etc.



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