[Spice-devel] [spice-common v2 4/8] build: Add missing G_GNUC_PRINTF annotations

Frediano Ziglio fziglio at redhat.com
Fri Mar 29 10:46:49 UTC 2019


> 
> They were suggested by gcc when using -Wsuggest-attribute=format
> 
> Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>

Acked-by: Frediano Ziglio <fziglio at redhat.com>

> ---
>  common/log.c         | 1 +
>  tests/test-logging.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/common/log.c b/common/log.c
> index b73da71..ce162a1 100644
> --- a/common/log.c
> +++ b/common/log.c
> @@ -33,6 +33,7 @@ SPICE_CONSTRUCTOR_FUNC(spice_log_init)
>      recorder_dump_on_common_signals(0, 0);
>  }
>  
> +G_GNUC_PRINTF(5, 0)
>  static void spice_logv(const char *log_domain,
>                         GLogLevelFlags log_level,
>                         const char *strloc,
> diff --git a/tests/test-logging.c b/tests/test-logging.c
> index 6a79ca9..32b0c33 100644
> --- a/tests/test-logging.c
> +++ b/tests/test-logging.c
> @@ -27,6 +27,7 @@
>  
>  #define OTHER_LOG_DOMAIN "Other"
>  #define LOG_OTHER_HELPER(suffix, level)
>  \
> +    G_GNUC_PRINTF(1, 2)
> \
>      static void G_PASTE(other_, suffix)(const gchar *format, ...)
>      \
>      {
>      \
>          va_list args;
>          \


More information about the Spice-devel mailing list