[Spice-devel] [protocol 1/3] macros: Improve the SPICE_GNUC_DEPRECATED* macros

Frediano Ziglio fziglio at redhat.com
Fri Aug 12 08:53:04 UTC 2016


> 
> On Fri, 12 Aug 2016, Frediano Ziglio wrote:
> 
> > > 
> > > If the user specifically requests access to the deprecated APIs by
> > > defining the SPICE_DEPRECATED macro, then turn off the
> > > SPICE_GNUC_DEPRECATED* warnings.
> > > Also automatically use G_GNUC_DEPRECATED if available.
> > > Add SPICE_GNUC_DEPRECATED_FOR().
> > > 
> > 
> > I'm not really sure it's a good idea to disable deprecation
> > warnings. If a program does want to ignore warnings I will
> > just force to avoid -Werror and tolerate the warnings.
> 
> The deprecation warnings are only disabled if one defines
> SPICE_DEPRECATED, which is obviously not the case by default.
> 
> This is needed by spice-gtk so it can implement those deprecated APIs
> that other applications may want to use without getting warnings
> itself.
> 

in spice-core.h these lines:

#ifdef SPICE_SERVER_INTERNAL
#undef SPICE_GNUC_DEPRECATED
#define SPICE_GNUC_DEPRECATED
#endif

are used to do it.

> That said, an additional patch could potentially move the
> -DSPICE_DEPRECATED from Makefile.am to a #define SPICE_DEPRECATED in the
> relevant C files so it does not have as large a footprint.
> 

Frediano


More information about the Spice-devel mailing list