[protocol,v2] macros: Remove unused SPICE_GNUC_XXX macros

Submitted by Francois Gouget on June 24, 2019, 10:36 a.m.

Details

Message ID E1hfMKb-0003GP-Ge@amboise
State Accepted
Commit 5874495db3e947f768d6f9d8615bb1b7f2c6c201
Headers show
Series "macros: Remove unused SPICE_GNUC_XXX macros" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Francois Gouget June 24, 2019, 10:36 a.m.
We don't want to maintain more macros than necessary and these have
been unused for over two years.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
---

v2: Remove unused macros altogether rather than marking them as 
    deprecated (no use of them has been found in spice, spice-gtk, 
    spice-common, spice-protocol, vd_agent and xf86-video-qxl in the 
    past two years).

 spice/macros.h | 16 ----------------
 1 file changed, 16 deletions(-)

Patch hide | download patch | download mbox

diff --git a/spice/macros.h b/spice/macros.h
index ab1d056..a23e866 100644
--- a/spice/macros.h
+++ b/spice/macros.h
@@ -34,19 +34,11 @@ 
 #include <spice/types.h>
 
 #if    __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-#define SPICE_GNUC_PURE __attribute__((__pure__))
 #define SPICE_GNUC_MALLOC __attribute__((__malloc__))
 #else
-#define SPICE_GNUC_PURE
 #define SPICE_GNUC_MALLOC
 #endif
 
-#if     __GNUC__ >= 4
-#define SPICE_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
-#else
-#define SPICE_GNUC_NULL_TERMINATED
-#endif
-
 #ifndef __has_feature
 #define __has_feature(x) 0  /* Compatibility with non-clang compilers. */
 #endif
@@ -62,20 +54,12 @@ 
 
 #if     __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
 #define SPICE_GNUC_PRINTF( format_idx, arg_idx ) __attribute__((__format__ (__printf__, format_idx, arg_idx)))
-#define SPICE_GNUC_SCANF( format_idx, arg_idx ) __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
-#define SPICE_GNUC_FORMAT( arg_idx ) __attribute__((__format_arg__ (arg_idx)))
 #define SPICE_GNUC_NORETURN __attribute__((__noreturn__))
-#define SPICE_GNUC_CONST __attribute__((__const__))
 #define SPICE_GNUC_UNUSED __attribute__((__unused__))
-#define SPICE_GNUC_NO_INSTRUMENT __attribute__((__no_instrument_function__))
 #else   /* !__GNUC__ */
 #define SPICE_GNUC_PRINTF( format_idx, arg_idx )
-#define SPICE_GNUC_SCANF( format_idx, arg_idx )
-#define SPICE_GNUC_FORMAT( arg_idx )
 #define SPICE_GNUC_NORETURN
-#define SPICE_GNUC_CONST
 #define SPICE_GNUC_UNUSED
-#define SPICE_GNUC_NO_INSTRUMENT
 #endif  /* !__GNUC__ */
 
 #ifdef G_DEPRECATED

Comments

> 
> We don't want to maintain more macros than necessary and these have
> been unused for over two years.
> 
> Signed-off-by: Francois Gouget <fgouget@codeweavers.com>

Acked for me (I'll wait)

> ---
> 
> v2: Remove unused macros altogether rather than marking them as
>     deprecated (no use of them has been found in spice, spice-gtk,
>     spice-common, spice-protocol, vd_agent and xf86-video-qxl in the
>     past two years).
> 
>  spice/macros.h | 16 ----------------
>  1 file changed, 16 deletions(-)
> 
> diff --git a/spice/macros.h b/spice/macros.h
> index ab1d056..a23e866 100644
> --- a/spice/macros.h
> +++ b/spice/macros.h
> @@ -34,19 +34,11 @@
>  #include <spice/types.h>
>  
>  #if    __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
> -#define SPICE_GNUC_PURE __attribute__((__pure__))
>  #define SPICE_GNUC_MALLOC __attribute__((__malloc__))
>  #else
> -#define SPICE_GNUC_PURE
>  #define SPICE_GNUC_MALLOC
>  #endif
>  
> -#if     __GNUC__ >= 4
> -#define SPICE_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
> -#else
> -#define SPICE_GNUC_NULL_TERMINATED
> -#endif
> -
>  #ifndef __has_feature
>  #define __has_feature(x) 0  /* Compatibility with non-clang compilers. */
>  #endif
> @@ -62,20 +54,12 @@
>  
>  #if     __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
>  #define SPICE_GNUC_PRINTF( format_idx, arg_idx ) __attribute__((__format__
>  (__printf__, format_idx, arg_idx)))
> -#define SPICE_GNUC_SCANF( format_idx, arg_idx ) __attribute__((__format__
> (__scanf__, format_idx, arg_idx)))
> -#define SPICE_GNUC_FORMAT( arg_idx ) __attribute__((__format_arg__
> (arg_idx)))
>  #define SPICE_GNUC_NORETURN __attribute__((__noreturn__))
> -#define SPICE_GNUC_CONST __attribute__((__const__))
>  #define SPICE_GNUC_UNUSED __attribute__((__unused__))
> -#define SPICE_GNUC_NO_INSTRUMENT __attribute__((__no_instrument_function__))
>  #else   /* !__GNUC__ */
>  #define SPICE_GNUC_PRINTF( format_idx, arg_idx )
> -#define SPICE_GNUC_SCANF( format_idx, arg_idx )
> -#define SPICE_GNUC_FORMAT( arg_idx )
>  #define SPICE_GNUC_NORETURN
> -#define SPICE_GNUC_CONST
>  #define SPICE_GNUC_UNUSED
> -#define SPICE_GNUC_NO_INSTRUMENT
>  #endif  /* !__GNUC__ */
>  
>  #ifdef G_DEPRECATED

Frediano