After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 94052 - GTK2 va_args usage on AMD Hammer platform
GTK2 va_args usage on AMD Hammer platform
Status: RESOLVED DUPLICATE of bug 90400
Product: gtk+
Classification: Platform
Component: Widget: Other
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-09-24 08:27 UTC by hhetter
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.0



Description hhetter 2002-09-24 08:27:13 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))
Comment 1 Owen Taylor 2002-09-24 08:36:46 UTC
Please file *separate* bugs for libbonobo,libbonoboui,gedit,
thanks!

*** This bug has been marked as a duplicate of 90400 ***