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 665293 - glibconfig includes glib/gmacros.h which results in error
glibconfig includes glib/gmacros.h which results in error
Status: RESOLVED INVALID
Product: glib
Classification: Platform
Component: general
2.31.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-12-01 14:50 UTC by Dominique Leuenberger
Modified: 2011-12-02 11:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Change glibconfig.h to only include glib.h (985 bytes, patch)
2011-12-01 14:51 UTC, Dominique Leuenberger
none Details | Review
New patch: Allow gmacros to be included from glibconfig.h (737 bytes, patch)
2011-12-01 16:47 UTC, Dominique Leuenberger
none Details | Review

Description Dominique Leuenberger 2011-12-01 14:50:59 UTC
since glib 2.31, only glib.h (and a few exceptions) can be #include'd

glib itself fails on this in the autogenerated glibconfig.h that is autogenerated from configure.

This makes any application #include'ing glibconfig.h fail.

Patch attached to change the include to glib.h only.
Comment 1 Dominique Leuenberger 2011-12-01 14:51:59 UTC
Created attachment 202523 [details] [review]
Change glibconfig.h to only include glib.h
Comment 2 Dominique Leuenberger 2011-12-01 15:38:05 UTC
Sorry.. that patch actually does not work (well, it was the 'obvious' thing to do... but it badly fails to bootstrap with this patch:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../glib -I../glib -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_ENABLE_DEBUG -DGLIB_COMPILATION -DPCRE_STATIC -pthread -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -c gatomic.c  -fPIC -DPIC -o .libs/gatomic.o
In file included from ./glib.h:33:0,
                 from ./glibconfig.h:9,
                 from ../glib/gtypes.h:34,
                 from ../glib/gmem.h:34,
                 from ../glib/glist.h:34,
                 from deprecated/gcompletion.h:34,
                 from deprecated/gcompletion.c:36:
../glib/garray.h:38:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'
../glib/garray.h:44:3: error: unknown type name 'gchar'
../glib/garray.h:45:3: error: unknown type name 'guint'
../glib/garray.h:50:3: error: unknown type name 'guint8'
../glib/garray.h:51:3: error: unknown type name 'guint'
../glib/garray.h:56:3: error: unknown type name 'gpointer'
../glib/garray.h:57:3: error: unknown type name 'guint'
Comment 3 Dominique Leuenberger 2011-12-01 16:47:54 UTC
Created attachment 202533 [details] [review]
New patch: Allow gmacros to be included from glibconfig.h

With this patch I can bootstrap and the application which originally triggered the issue for me (pan) can be successfully built as well.
Comment 4 Allison Karlitskaya (desrt) 2011-12-02 05:49:36 UTC
hi Dominique,

We have been advertising for some time that the only acceptable header to include from GLib is <glib.h>.  It is intended that code that includes other headers directly should now fail to compile.
Comment 5 Dominique Leuenberger 2011-12-02 08:35:26 UTC
Ryan,

Does that mean that glibconfig.h is NOT supposed to be included neither by any app? Note: glibconfig.h is NOT pulled in by glib.h (like a few others as well) (but I did not check if it is infact being pulled by any other header... that might well be)

glibconfig.h is being auto-generated by glib's configure script (configure.ac).
My first patch was an obvious 'do not include anything else from glibconfig.h', but that broke even bootstrapping.
Comment 6 Dan Winship 2011-12-02 09:11:54 UTC
glibconfig.h is included by gtypes.h, which is included by glib.h
Comment 7 Dominique Leuenberger 2011-12-02 09:12:58 UTC
ahh! Thanks.. .that's the missing link I missed.. I'm just building the 'offending' app without including glibconfig.h and in this case very likely we can just close this bug here..

sorry!
Comment 8 Dominique Leuenberger 2011-12-02 11:25:53 UTC
Indeed. It was only my own oversight for having missed that glibconfig is in fact indirectly included in all builds. Please discard. And sorry for that.