[Bug 653266] qt-gstreamer build failed with glib2-2.29.8

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Thu Jun 23 14:35:23 PDT 2011


https://bugzilla.gnome.org/show_bug.cgi?id=653266
  GStreamer | qt-gstreamer | 0.10.1

George Kiagiadakis <kiagiadakis.george> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1

--- Comment #1 from George Kiagiadakis <kiagiadakis.george at gmail.com> 2011-06-23 21:35:17 UTC ---
Confirmed. Some debug information:

line 129 reads:

return (GST_CAPS_REFCOUNT_VALUE(object<GstCaps>()) == 1);

and GST_CAPS_REFCOUNT_VALUE is actually:

#define GST_CAPS_REFCOUNT_VALUE(caps) \
 (g_atomic_int_get (&(GST_CAPS(caps))->refcount))

The problem relies on the implementation of g_atomic_int_get. In glib 2.28, it
is defined as:

# define g_atomic_int_get(atomic) \
 ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gint) ? 1 : -1]), \
  (g_atomic_int_get) ((volatile gint G_GNUC_MAY_ALIAS *) (volatile void *)
(atomic)))

...which works (despite being unreadable :P).
However, in glib 2.29 it is defined as:

#define g_atomic_int_get(atomic) \
  (G_GNUC_EXTENSION ({                                    \
    G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint));  \
    (void) (0 ? *(atomic) ^ *(atomic) : 0);               \
    __sync_synchronize ();                                \
    (gint) *(atomic);                                     \
  }))

which fails if "atomic" is a call to a C++ member function.
The bug actually appears in G_STATIC_ASSERT, which is defined as:

#define G_STATIC_ASSERT(expr) typedef struct { char
Compile_Time_Assertion[(expr) ? 1 : -1]; } G_PASTE (_GStaticAssert_, __LINE__)

A quick test reveals that the following fails to compile:

typedef struct {
  char Compile_Time_Assertion[
     (sizeof(object<GstCaps>()->refcount) == sizeof(gint)) ? 1 : -1
  ];
} Foobar;

...while this one works fine:

typedef struct {
  char Compile_Time_Assertion[
     (sizeof(this->object<GstCaps>()->refcount) == sizeof(gint)) ? 1 : -1
  ];
} Foobar;

Imho, this is a compiler bug. An explicit use of the "this" pointer should not
be required in the context of a member function.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list