[Spice-devel,client,v3,06/10] build-sys: Remove SPICE_NO_DEPRECATED

Submitted by Francois Gouget on Oct. 27, 2016, 4:41 p.m.

Details

Message ID 8b8d60629b8edf789a80a2889e5db3b6ae8f43d3.1477585592.git.fgouget@free.fr
State New
Headers show
Series "Deprecation warning cleanup" ( rev: 5 ) in Spice

Not browsing as part of any series.

Commit Message

Francois Gouget Oct. 27, 2016, 4:41 p.m.
Deprecation warnings no longer cause compilation errors.
Also they should either be fixed or ignored with
G_GNUC_{BEGIN,END}_IGNORE_DEPRECATIONS.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
---
 src/Makefile.am  |  1 -
 src/spice-util.h | 12 +++---------
 2 files changed, 3 insertions(+), 10 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/Makefile.am b/src/Makefile.am
index 78953dd..3f81866 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -77,7 +77,6 @@  KEYMAP_GEN = $(srcdir)/keymap-gen.pl
 SPICE_COMMON_CPPFLAGS =						\
 	-DSPICE_COMPILATION					\
 	-DG_LOG_DOMAIN=\"GSpice\"				\
-	-DSPICE_NO_DEPRECATED					\
 	-DSPICE_GTK_LOCALEDIR=\"${SPICE_GTK_LOCALEDIR}\"	\
 	-DPNP_IDS=\""$(PNP_IDS)"\"				\
 	-DUSB_IDS=\""$(USB_IDS)"\"				\
diff --git a/src/spice-util.h b/src/spice-util.h
index 88e3a57..a01da0c 100644
--- a/src/spice-util.h
+++ b/src/spice-util.h
@@ -41,22 +41,16 @@  gchar* spice_uuid_to_string(const guint8 uuid[16]);
 #define SPICE_RESERVED_PADDING (10 * sizeof(void*))
 
 /* need to be in a public header */
-#ifndef SPICE_GNUC_DEPRECATED_FOR
+#ifndef SPICE_DEPRECATED_FOR
 #if    __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-#define SPICE_GNUC_DEPRECATED_FOR(f)                        \
+#define SPICE_DEPRECATED_FOR(f)                        \
   __attribute__((deprecated("Use " #f " instead")))
 #else
-#define SPICE_GNUC_DEPRECATED_FOR(f)        G_GNUC_DEPRECATED
+#define SPICE_DEPRECATED_FOR(f)        G_GNUC_DEPRECATED
 #endif /* __GNUC__ */
 #endif
 
-#ifndef SPICE_NO_DEPRECATED
-#define SPICE_DEPRECATED_FOR(f)  SPICE_GNUC_DEPRECATED_FOR(f)
 #define SPICE_DEPRECATED  G_GNUC_DEPRECATED
-#else
-#define SPICE_DEPRECATED_FOR(f)
-#define SPICE_DEPRECATED
-#endif
 
 G_END_DECLS
 

Comments

On Thu, 2016-10-27 at 18:41 +0200, Francois Gouget wrote:
> Deprecation warnings no longer cause compilation errors.

Since when? 

> Also they should either be fixed or ignored with
> G_GNUC_{BEGIN,END}_IGNORE_DEPRECATIONS.

So this patch is re-enabling the deprecated functions so that we will
notice and fix these warnings? I'd kind of like a bit more explanation
in the commit log about the motifvation for this patch.


> 
> Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
> ---
>  src/Makefile.am  |  1 -
>  src/spice-util.h | 12 +++---------
>  2 files changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 78953dd..3f81866 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -77,7 +77,6 @@ KEYMAP_GEN = $(srcdir)/keymap-gen.pl
>  SPICE_COMMON_CPPFLAGS =						
> \
>  	-DSPICE_COMPILATION					\
>  	-DG_LOG_DOMAIN=\"GSpice\"				\
> -	-DSPICE_NO_DEPRECATED					
> \
>  	-DSPICE_GTK_LOCALEDIR=\"${SPICE_GTK_LOCALEDIR}\"	\
>  	-DPNP_IDS=\""$(PNP_IDS)"\"				\
>  	-DUSB_IDS=\""$(USB_IDS)"\"				\
> diff --git a/src/spice-util.h b/src/spice-util.h
> index 88e3a57..a01da0c 100644
> --- a/src/spice-util.h
> +++ b/src/spice-util.h
> @@ -41,22 +41,16 @@ gchar* spice_uuid_to_string(const guint8
> uuid[16]);
>  #define SPICE_RESERVED_PADDING (10 * sizeof(void*))
>  
>  /* need to be in a public header */
> -#ifndef SPICE_GNUC_DEPRECATED_FOR
> +#ifndef SPICE_DEPRECATED_FOR
>  #if    __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
> -#define SPICE_GNUC_DEPRECATED_FOR(f)                        \
> +#define SPICE_DEPRECATED_FOR(f)                        \
>    __attribute__((deprecated("Use " #f " instead")))
>  #else
> -#define SPICE_GNUC_DEPRECATED_FOR(f)        G_GNUC_DEPRECATED
> +#define SPICE_DEPRECATED_FOR(f)        G_GNUC_DEPRECATED
>  #endif /* __GNUC__ */
>  #endif
>  
> -#ifndef SPICE_NO_DEPRECATED
> -#define SPICE_DEPRECATED_FOR(f)  SPICE_GNUC_DEPRECATED_FOR(f)
>  #define SPICE_DEPRECATED  G_GNUC_DEPRECATED
> -#else
> -#define SPICE_DEPRECATED_FOR(f)
> -#define SPICE_DEPRECATED
> -#endif
>  
>  G_END_DECLS
>
On Thu, 27 Oct 2016, Jonathon Jongsma wrote:

> On Thu, 2016-10-27 at 18:41 +0200, Francois Gouget wrote:
> > Deprecation warnings no longer cause compilation errors.
> 
> Since when? 

Right. That change comes from the last patch in the series. In fact if 
this patch is applied alone there are still no compilation errors 
because currently deprecation warnings are disabled globally.


> > Also they should either be fixed or ignored with
> > G_GNUC_{BEGIN,END}_IGNORE_DEPRECATIONS.
> 
> So this patch is re-enabling the deprecated functions so that we will
> notice and fix these warnings? I'd kind of like a bit more explanation
> in the commit log about the motifvation for this patch.

The deprecated functions were never 'disabled'. That is, with or without 
SPICE_NO_DEPRECATED, their prototypes are always defined in their 
respective headers. The only difference is that if SPICE_NO_DEPRECATED 
is defined they are not tagged as deprecated.

You may be confusing SPICE_NO_DEPRECATED with spice-protocol's 
SPICE_DEPRECATED macro (if defined it removes a pair of constants).