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 656421 - gtk+ 3.1.10: G_DISABLE_DEPRECATED detection breaks compilation
gtk+ 3.1.10: G_DISABLE_DEPRECATED detection breaks compilation
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-08-12 18:49 UTC by Sebastian Pipping
Modified: 2011-09-05 04:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Pipping 2011-08-12 18:49:53 UTC
Despite all the text: this is AN EASY TARGET, trust me :-)

With glib 2.29.14 and gdk-pixbuf 2.22.1 installed, compilation of gtk+ 3.1.10 fails - details follow.

gdk-pixbuf 2.22.1 relies on G_CONST_RETURN which is deprecated by now.
To have it defined G_DISABLE_DEPRECATED must be unset - quoting from <glib/gmacros.h>:

=====================================
/* Deprecated -- do not use. */
#ifndef G_DISABLE_DEPRECATED
#ifdef G_DISABLE_CONST_RETURNS
#define G_CONST_RETURN
#else
#define G_CONST_RETURN const
#endif
#endif
=====================================

However, this check of gtk+ 3.1.10

=============================================================
# See if it's safe to turn G_DISABLE_DEPRECATED on.
GLIB_VERSION_MAJOR_MINOR=`$PKG_CONFIG --modversion glib-2.0 | sed "s/\.@<:@^.@:>@*\$//"`
GLIB_REQUIRED_VERSION_MAJOR_MINOR=`echo glib_required_version | sed "s/\.@<:@^.@:>@*\$//"`
if test "x$GLIB_VERSION_MAJOR_MINOR" = "x$GLIB_REQUIRED_VERSION_MAJOR_MINOR"; then
  CFLAGS="-DG_DISABLE_DEPRECATED $CFLAGS"
fi
=============================================================

seems to define G_DISABLE_DEPRECATED even for my cobination of glib 2.29.14 and gdk-pixbuf 2.22.1, which is officially supported by gtk+ 3.1.10 according to its configure.ac:

=============================================================
[..]
# required versions of other packages
m4_define([glib_required_version], [2.29.14])
[..]
m4_define([gdk_pixbuf_required_version], [2.22.0])
[..]
=============================================================

The error I run into precisely is this:

=============================================================
# pwd
[..]/gtk+-3.1.10/gdk/x11
# /bin/sh ../../libtool --silent --tag=CC   --mode=compile x86_64-pc-linux-gnu-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../..  -DG_LOG_DOMAIN=\"Gdk\" -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk -DG_ENABLE_DEBUG -DG_ERRORCHECK_MUTEXES -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -I/usr/include/libdrm -I/usr/include/gio-unix-2.0/ -I/usr/include/gdk-pixbuf-2.0    -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES  -DGDK_PIXBUF_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED  -march=core2 -O2 -pipe -Wall -c -o gdkcursor-x11.lo gdkcursor-x11.c
In file included from /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf.h:35,
                 from gdkcursor-x11.c:31:
/usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixbuf-core.h:260: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'gchar'
[..]
=============================================================

That call success when I do one out of:
(A) Add -DG_CONST_RETURN=const
(B) Removing -DG_DISABLE_DEPRECATED
(C) Upgrade gdk-pixbuf to 2.23.5

So the fix I would like to ask for is either:
[A] Take the version of gdk-pixbuf into account for the G_DISABLE_DEPRECATED chec in gtk+'s configure.ac
[B] Bump the version number in the requirement on gdk-pixbuf

Thanks!
Comment 1 Sebastian Pipping 2011-08-12 18:55:42 UTC
PS: Line 260/261 of gdk-pixbuf-core.h is this:

=============================================================
G_CONST_RETURN gchar * gdk_pixbuf_get_option (GdkPixbuf   *pixbuf,
                                              const gchar *key);
=============================================================

Note the G_CONST_RETURN up front.
Comment 2 Javier Jardón (IRC: jjardon) 2011-08-12 19:03:57 UTC
Hello Sebastian, thanks for the bug report.

Fixed in commit http://git.gnome.org/browse/gtk+/commit/?id=8afe90224b05ad2cd0e1f836634247683c3040b4
Comment 3 Sebastian Pipping 2011-08-12 19:10:11 UTC
Nice!  I dare re-opening the bug (instead of opening a new one) because the (hophefully) exact same thing seems to happen with ATK:

With 1.32.0 installed I get errors on G_CONST_RETURN due to G_DISABLE_DEPRECATED, despite being permitted by configure.ac.  Instead, with ATK 2.1.0 installed GTK+ 3.1.10 compiles.
Comment 4 Matthias Clasen 2011-09-05 04:05:48 UTC
atk dep has been  bumped as well