From 7e2aae7942f4232ee7a9e84c52d265b722890da3 Mon Sep 17 00:00:00 2001 From: Lukasz Forynski Date: Mon, 23 Nov 2015 21:40:34 +0000 Subject: [PATCH] info: fix compiler warning with -Wpedantic and gcc 5 Gstreamer compiled with gcc 5.2 and -Wpedantic produces the following warning: 'ISO C does not support '__FUNCTION__' predefined identifier [-Wpedantic] const char *s = __FUNCTION__;' Since gcc 5 enables C99 by default, use __func__ if it's available instead of the non-standard __FUNCTION__ (as suggested in [2]). [1]: https://gcc.gnu.org/gcc-5/changes.html [2]: https://gcc.gnu.org/gcc-5/porting_to.html https://bugzilla.gnome.org/show_bug.cgi?id=758541 --- gst/gstinfo.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gst/gstinfo.h b/gst/gstinfo.h index d4678ac76a..bc7580dc26 100644 --- a/gst/gstinfo.h +++ b/gst/gstinfo.h @@ -250,10 +250,10 @@ struct _GstDebugCategory { * function signature in C++ code. */ #ifndef GST_FUNCTION -#if defined (__GNUC__) || (defined (_MSC_VER) && _MSC_VER >= 1300) -# define GST_FUNCTION ((const char*) (__FUNCTION__)) -#elif defined (__STDC__) && defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#if defined (__STDC__) && defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L # define GST_FUNCTION ((const char*) (__func__)) +#elif defined (__GNUC__) || (defined (_MSC_VER) && _MSC_VER >= 1300) +# define GST_FUNCTION ((const char*) (__FUNCTION__)) #else # define GST_FUNCTION ((const char*) ("???")) #endif