diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-09-26 08:42:30 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-09-26 09:06:30 +0200 |
commit | 91cb1710574309b4c52b388bb5cc7a4e899050bc (patch) | |
tree | 98b4c31d2819881d3d061cdf4e299f46bbeba8ee | |
parent | 02a7af780b4070884d60823e03acfc2dc3ded852 (diff) | |
download | glib-91cb1710574309b4c52b388bb5cc7a4e899050bc.tar.gz |
Improve GLIB_DEPRECATED_MACRO_FOR output
See the mailing list thread <https://lists.fedoraproject.org/archives/list/
devel@lists.fedoraproject.org/thread/SZ676IHHSLOQD6UN2I5J5VKXJ5P5SOVO/>
"glib-2.0 G_CONST_RETURN causing GCC 'warning: const' on F31", where the GCC
diagnostic
> test.c:2:13: warning: const
> 2 | G_CONST_RETURN char * f();
> | ^~~~~~~
had confused me, and "Deprecated pre-processor symbol, repace with const" is
probably a better warning message than just "const".
(That recent GCC only prints "Deprecated pre-processor symbol, repace with "
appears to be a bug in GCC that GLIB_UNAVAILABLE_MACRO already suffers from,
too. Recent Clang correctly prints "Deprecated pre-processor symbol, repace
with const".)
-rw-r--r-- | glib/gmacros.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/glib/gmacros.h b/glib/gmacros.h index 4dad64dc0..e829f207b 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -987,7 +987,7 @@ __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4)) #define _GLIB_GNUC_DO_PRAGMA(x) _Pragma(G_STRINGIFY (x)) #define GLIB_DEPRECATED_MACRO _GLIB_GNUC_DO_PRAGMA(GCC warning "Deprecated pre-processor symbol") -#define GLIB_DEPRECATED_MACRO_FOR(f) _GLIB_GNUC_DO_PRAGMA(GCC warning #f) +#define GLIB_DEPRECATED_MACRO_FOR(f) _GLIB_GNUC_DO_PRAGMA(GCC warning "Deprecated pre-processor symbol, replace with " #f) #define GLIB_UNAVAILABLE_MACRO(maj,min) _GLIB_GNUC_DO_PRAGMA(GCC warning "Not available before " #maj "." #min) #else #define GLIB_DEPRECATED_MACRO |