[Spice-devel] [protocol 1/3] macros: Improve the SPICE_GNUC_DEPRECATED* macros
Francois Gouget
fgouget at codeweavers.com
Fri Aug 12 14:46:22 UTC 2016
On Fri, 12 Aug 2016, Frediano Ziglio wrote:
> >
> > 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 seems redundant with the SPICE_DEPRECATED mechanism. Also, as in
spice-gtk, it's again global (-DSPICE_SERVER_INTERNAL in
server/Makefile.am), impacting all the Spice server source files, even
those that have no business using the deprecated APIs.
It's also yet another way of achieving the same thing:
* spice-protocol -> define SPICE_DEPRECATED
* spice-gtk -> define SPICE_NO_DEPRECATED
* spice -> define SPICE_SERVER_INTERNAL
--
Francois Gouget <fgouget at codeweavers.com>
More information about the Spice-devel
mailing list