Bug#303124: g++-2.95 spews out lots of warnings with glib header files

Kevin Ryde user42 at zip.com.au
Tue Dec 5 20:00:21 CET 2006


Loïc Minier <lool at dooz.org> writes:
>
>  I'm not sure upstream would accept a patch cluttering the headers for
>  to avoid warnings with an old compiler.

Nosing around in /usr/lib/glib-2.0/include/glibconfig.h I see there's
just such a 2.95 conditional on G_HAVE_ISO_VARARGS, if that could be
extended to G_HAVE_GNUC_VISIBILITY.  Changing to the following works
for me


#define G_HAVE_GNUC_VARARGS 1
#define G_HAVE_GROWING_STACK 0
#define G_HAVE_GNUC_VISIBILITY 1

/* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi
 * is passed ISO vararg support is turned off, and there is no work
 * around to turn it on, so we unconditionally turn it off.
 *
 * gcc-2.95.x doesn't have __attribute__((visibility ...)).
 */
#if __GNUC__ == 2 && __GNUC_MINOR__ == 95
#  undef G_HAVE_ISO_VARARGS
#  undef G_HAVE_GNUC_VISIBILITY
#endif

#if G_HAVE_GNUC_VISIBILITY
#define G_GNUC_INTERNAL __attribute__((visibility("hidden")))
#else
#define G_GNUC_INTERNAL
#endif





More information about the Pkg-gnome-maintainers mailing list