mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-02 11:56:38 +02:00
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:
33
glib/docs.c
33
glib/docs.c
@@ -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:
|
||||
*
|
||||
|
Reference in New Issue
Block a user