GNOME Bugzilla – Bug 567692
gstinfo.h header not compatible with C++
Last modified: 2009-04-17 09:15:59 UTC
Description /usr/include/gstreamer-0.10/gst/gstinfo.h includes the following #ifndef GST_FUNCTION #if defined (__GNUC__) # define GST_FUNCTION ((const char*) (__FUNCTION__)) #elif defined (G_HAVE_ISO_VARARGS) # define GST_FUNCTION ((const char*) (__func__)) #else # define GST_FUNCTION ((const char*) ("???")) #endif #endif /* ifndef GST_FUNCTION */ When using Sun Studio CC, __GNUC__ is not set. However, G_HAVE_ISO_VARARGS is set (in /usr/lib/glib-2.0/include/glibconfig.h), for both C and C++ compilation (which in my opinion is correct). So this does not compile with CC (I expect that it shouldn't compile either with cc for ISO C 90 code, but I haven't tried that). This is because '__func__' is an ISO C 99 feature. GCC allows this feature to creep into C++ (and ISO C 90) code, but Sun Studio is stricter. Back to gstreamer, I don't see any relationship between varargs and ISO C 99 __func__. Steps to Reproduce Try building Qt 4.4.1. Build will fail during Phonon. Workaround As a workaround, change the line testing G_HAVE_ISO_VARARGS to #elif defined(__STDC__) && (__STDC_VERSION__ >= 199901L) Could this issue be fixed in the GStreamer header files?
Any chance of getting this into the prerelease?
Yep, please commit.
commit e6a3fd9bbbfbee55c93c60dab322693b41113ea8 Author: Brian Cameron <brian.cameron@sun.com> Date: Fri Apr 17 10:11:21 2009 +0100 gstinfo: don't assume G_HAVE_ISO_VARARGS implies ISO C99 Makes headers C++ clean, esp. with the Sun compilers. Fixes #567692.