Add G_GNUC_BEGIN/END_IGNORE_DEPRECATIONS

Add new macros to disable -Wdeprecated-declarations around a piece of
code, using the C99 (and GNU89) _Pragma() operator. Replace the
existing use of #pragma for this in gio, and suppress the warnings in
gvaluearray.c as well.

https://bugzilla.gnome.org/show_bug.cgi?id=669671
This commit is contained in:
Dan Winship
2012-02-10 08:49:17 -05:00
parent ab59739e11
commit ca05902a58
6 changed files with 56 additions and 6 deletions

View File

@@ -1986,6 +1986,39 @@
* Since: 2.26
*/
/**
* G_GNUC_BEGIN_IGNORE_DEPRECATIONS:
*
* Tells <command>gcc</command> (if it is a new enough version) to
* temporarily stop emitting warnings when functions marked with
* %G_GNUC_DEPRECATED or %G_GNUC_DEPRECATED_FOR are called. This is
* useful for when you have one deprecated function calling another
* one, or when you still have regression tests for deprecated
* functions.
*
* Use %G_GNUC_END_IGNORE_DEPRECATIONS to begin warning again. (If you
* are not compiling with <literal>-Wdeprecated-declarations</literal>
* then neither macro has any effect.)
*
* This macro can be used either inside or outside of a function body,
* but must appear on a line by itself.
*
* Since: 2.32
*/
/**
* G_GNUC_END_IGNORE_DEPRECATIONS:
*
* Undoes the effect of %G_GNUC_BEGIN_IGNORE_DEPRECATIONS, telling
* <command>gcc</command> to begin outputting warnings again
* (assuming those warnings had been enabled to begin with).
*
* This macro can be used either inside or outside of a function body,
* but must appear on a line by itself.
*
* Since: 2.32
*/
/**
* G_GNUC_NORETURN:
*