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 560591 - 2.15.4 pygobject.c build failure with Sun Studio C compiler
2.15.4 pygobject.c build failure with Sun Studio C compiler
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
2.15.x
Other Solaris
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2008-11-13 05:19 UTC by Tim Mooney
Modified: 2009-04-21 17:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
workaround (473 bytes, patch)
2009-04-14 21:02 UTC, Paul Pogonyshev
committed Details | Review

Description Tim Mooney 2008-11-13 05:19:06 UTC
Building on x86_64-sun-solaris2.10 with either the Sun Studio 12 compiler or the Sun Studio Express compiler (what will be "Studio 13") results in a compile error in gobject/pygobject.c because of the struct with no members:

Making all in gobject
gmake[2]: Entering directory `/local/src/RPM/BUILD/pygobject-2.15.4/gobject'
source='pygobject.c' object='_gobject_la-pygobject.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ../depcomp \
/bin/bash ../libtool --tag=CC   --mode=compile cc -DHAVE_CONFIG_H -I. -I..   -xtarget=generic -m64 -xarch=generic -I/local/include -I/local/gnu/include -I/usr/local/include  -I/local/include/python2.6 -I/local/include/python2.6  -D_REENTRANT -D_PTHREADS -I/local/gnu/include/glib-2.0 -I/local/gnu/lib/64/glib-2.0/include   -DPY_SSIZE_T_CLEAN -I../glib  -Xa -xO3 -xstrconst -mt -KPIC -xtarget=generic -m64 -xarch=generic -I/local/include -I/local/gnu/include -I/usr/local/include -c -o _gobject_la-pygobject.lo `test -f 'pygobject.c' || echo './'`pygobject.c
 cc -DHAVE_CONFIG_H -I. -I.. -xtarget=generic -m64 -xarch=generic -I/local/include -I/local/gnu/include -I/usr/local/include -I/local/include/python2.6 -I/local/include/python2.6 -D_REENTRANT -D_PTHREADS -I/local/gnu/include/glib-2.0 -I/local/gnu/lib/64/glib-2.0/include -DPY_SSIZE_T_CLEAN -I../glib -Xa -xO3 -xstrconst -mt -KPIC -xtarget=generic -m64 -xarch=generic -I/local/include -I/local/gnu/include -I/usr/local/include -c pygobject.c  -KPIC -DPIC -o .libs/_gobject_la-pygobject.o
"pygobject.c", line 187: warning: syntax error:  empty declaration
"pygobject.c", line 338: warning: syntax error:  empty declaration
"pygobject.c", line 422: zero-sized struct/union
"pygobject.c", line 423: warning: syntax error:  empty declaration
"pygobject.c", line 987: warning: syntax error:  empty declaration
"pygobject.c", line 2085: warning: syntax error:  empty declaration
cc: acomp failed for pygobject.c
gmake[2]: *** [_gobject_la-pygobject.lo] Error 1
gmake[2]: Leaving directory `/local/src/RPM/BUILD/pygobject-2.15.4/gobject'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/local/src/RPM/BUILD/pygobject-2.15.4'
gmake: *** [all] Error 2


The error is line 422 of pygobject.c:

struct empty {} _empty;


The 2.14.x pygobject series doesn't have this problem.
Comment 1 Paul Pogonyshev 2009-04-14 21:02:21 UTC
Created attachment 132658 [details] [review]
workaround

Please test if this solves the problem for you.

To verify that it doesn't change object size (i.e. it's a change only to make the Sun compiler happy, nothing else) I used this:

import gobject
print type (gobject.GObject.__dict__['props']).__basicsize__
Comment 2 Paul Pogonyshev 2009-04-21 17:30:23 UTC
I'll just go ahead and commit this patch.