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 527328 - g_static_mutex_lock throws "incompatible pointer" warning/error on ppc
g_static_mutex_lock throws "incompatible pointer" warning/error on ppc
Status: RESOLVED DUPLICATE of bug 316221
Product: glib
Classification: Platform
Component: gthread
2.16.x
Other All
: Normal critical
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-04-10 11:20 UTC by Dan Horák
Modified: 2008-04-13 15:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24



Description Dan Horák 2008-04-10 11:20:39 UTC
Steps to reproduce:
Due the different implementations of g_static_mutex_[un]lock between i386/x86_64 and ppc/ppc64 architectures there are problems when an application is compiled with -Werror.

I have this code (taken from the OpenHPI project):
-----------------------
#include <glib.h>

static GStaticMutex oh_uid_lock = G_STATIC_MUTEX_INIT;

void oh_uid_initialize(void)
{
        g_static_mutex_lock(&oh_uid_lock);
}
-----------------------

and it leads after many simplifications onto:
-----------------------
typedef struct _GStaticMutex GStaticMutex;
struct _GStaticMutex
{
  struct _GMutex *runtime_mutex;
};

typedef void* gpointer;

gpointer g_atomic_pointer_get (volatile gpointer *atomic);

static GStaticMutex oh_uid_lock = { ((void *)0) };

void oh_uid_initialize(void);

void oh_uid_initialize(void)
{
    g_atomic_pointer_get (&((&oh_uid_lock)->runtime_mutex));
}
-----------------------

and the resulting error message is

cc1: warnings being treated as errors
test.c: In function ‘oh_uid_initialize’:
test.c:23: warning: passing argument 1 of ‘g_atomic_pointer_get’ from incompatible pointer type


Stack trace:


Other information:
Comment 2 Dan Williams 2008-04-13 15:06:01 UTC

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