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 567692 - gstinfo.h header not compatible with C++
gstinfo.h header not compatible with C++
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.x
Other opensolaris
: Normal blocker
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-14 00:23 UTC by Brian Cameron
Modified: 2009-04-17 09:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Brian Cameron 2009-01-14 00:23:21 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?
Comment 1 Tim-Philipp Müller 2009-04-16 19:41:40 UTC
Any chance of getting this into the prerelease?
Comment 2 Jan Schmidt 2009-04-17 07:57:42 UTC
Yep, please commit.
Comment 3 Tim-Philipp Müller 2009-04-17 09:15:59 UTC
 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.