GNOME Bugzilla – Bug 94052
GTK2 va_args usage on AMD Hammer platform
Last modified: 2004-12-22 21:47:04 UTC
GTK2 declares it's types in an enum from gtypes which results in integers. But all types are extracted from va_list as GType (gulong)), this is forbidden on Hammer, as the va_args-handling on Hammer is ISO-C conform which means you cannot insert an int and extract a long type. (This is valid on any other 64-bit platform!) On 32-bit platforms it doesn't matter, as sizeof(long)==sizeof(int). We now just casted the GTK_TYPE_* to GType, so it works. (see patch below) The same problem exists in libbonobo and libbonobo_ui, there the va_list end is marked with 0, which also is an integer. We just exchanged the '0' with '(glong)0' in all functions. Gedit had a function which expected an 'int*' but was given a '&gsize' (gsize == long). which leads also to unpredictable results. --- ./gtk/gtktypeutils.h.ORG 2002-09-05 16:51:38.000000000 +0200 +++ ./gtk/gtktypeutils.h 2002-09-05 16:52:43.000000000 +0200 @@ -61,6 +61,26 @@ GTK_TYPE_POINTER = G_TYPE_POINTER } GtkFundamentalType; + #define GTK_TYPE_INVALID (GType) GTK_TYPE_INVALID + #define GTK_TYPE_NONE (GType) GTK_TYPE_NONE + #define GTK_TYPE_ENUM (GType) GTK_TYPE_ENUM + #define GTK_TYPE_FLAGS (GType) GTK_TYPE_FLAGS + + /* GtkArg types */ + #define GTK_TYPE_CHAR (GType) GTK_TYPE_CHAR + #define GTK_TYPE_UCHAR (GType) GTK_TYPE_UCHAR + #define GTK_TYPE_BOOL (GType) GTK_TYPE_BOOL + #define GTK_TYPE_INT (GType) GTK_TYPE_INT + #define GTK_TYPE_UINT (GType) GTK_TYPE_UINT + #define GTK_TYPE_LONG (GType) GTK_TYPE_LONG + #define GTK_TYPE_ULONG (GType) GTK_TYPE_ULONG + #define GTK_TYPE_FLOAT (GType) GTK_TYPE_FLOAT + #define GTK_TYPE_DOUBLE (GType) GTK_TYPE_DOUBLE + #define GTK_TYPE_STRING (GType) GTK_TYPE_STRING + #define GTK_TYPE_BOXED (GType) GTK_TYPE_BOXED + #define GTK_TYPE_POINTER (GType) GTK_TYPE_POINTER + + /* --- type macros --- */ #define GTK_CLASS_NAME(class) (g_type_name (G_TYPE_FROM_CLASS (class))) #define GTK_CLASS_TYPE(class) (G_TYPE_FROM_CLASS (class))
Please file *separate* bugs for libbonobo,libbonoboui,gedit, thanks! *** This bug has been marked as a duplicate of 90400 ***