[Spice-devel] [protocol] macros: Use GLib's G_DEPRECATED macro if available
Francois Gouget
fgouget at codeweavers.com
Mon Nov 21 18:13:42 UTC 2016
On Wed, 9 Nov 2016, Christophe Fergeau wrote:
[...]
> I believe all of these were more or less directly imported from glib.
> Grepping around, I could only find SPICE_GNUC_VISIBLE, SPICE_GNUC_NORETURN,
> SPICE_GNUC_UNUSED, SPICE_GNUC_PRINTF and SPICE_GNUC_DEPRECATED being
> used. At this point, I'd just make sure the other ones emit a (compile
> time) warning when they are used unless some magic define is set, and
> drop them after a while.
I'm not sure how to do that:
* If I'm not mistaken a #warning directive must be used alone on a
line but this is not how __attribute__ is used. Furthermore I doubt
#warning would even work if put inside a macro and putting it inside
the #ifdef would warn about the macro being defined, not about it
being used.
* I could define the macro to something like 'define FOO to use this
macro' but this would generate a compilation error, not a compilation
warning.
--
Francois Gouget <fgouget at codeweavers.com>
More information about the Spice-devel
mailing list