GNOME Bugzilla – Bug 560591
2.15.4 pygobject.c build failure with Sun Studio C compiler
Last modified: 2009-04-21 17:30:23 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.
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__
I'll just go ahead and commit this patch.