Re: [PATCH] Add SPICE_ATTR_NORETURN on prototype of error functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> From: Christophe de Dinechin <dinechin@xxxxxxxxxx>
> 
> The error functions are supposed to not return.  Using the attribute
> documents that in the interface, and is better for the compiler
> because most noreturn-related optimizations and spurious warning
> eliminations happen at the call site.
> 
> Signed-off-by: Christophe de Dinechin <dinechin@xxxxxxxxxx>
> ---
>  common/lz.h   | 1 +
>  common/quic.h | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/common/lz.h b/common/lz.h
> index 21ba1fa..23910b8 100644
> --- a/common/lz.h
> +++ b/common/lz.h
> @@ -19,6 +19,7 @@ typedef void *LzContext;
>  
>  typedef struct LzUsrContext LzUsrContext;
>  struct LzUsrContext {
> +    SPICE_ATTR_NORETURN
>      SPICE_ATTR_PRINTF(2, 3) void (*error)(LzUsrContext *usr, const char
>      *fmt, ...);
>      SPICE_ATTR_PRINTF(2, 3) void (*warn)(LzUsrContext *usr, const char *fmt,
>      ...);
>      SPICE_ATTR_PRINTF(2, 3) void (*info)(LzUsrContext *usr, const char *fmt,
>      ...);
> diff --git a/common/quic.h b/common/quic.h
> index 7c1da85..398fb09 100644
> --- a/common/quic.h
> +++ b/common/quic.h
> @@ -41,6 +41,7 @@ typedef void *QuicContext;
>  
>  typedef struct QuicUsrContext QuicUsrContext;
>  struct QuicUsrContext {
> +    SPICE_ATTR_NORETURN
>      SPICE_ATTR_PRINTF(2, 3) void (*error)(QuicUsrContext *usr, const char
>      *fmt, ...);
>      SPICE_ATTR_PRINTF(2, 3) void (*warn)(QuicUsrContext *usr, const char
>      *fmt, ...);
>      SPICE_ATTR_PRINTF(2, 3) void (*info)(QuicUsrContext *usr, const char
>      *fmt, ...);

Acked-by: Frediano Ziglio <fziglio@xxxxxxxxxx>

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]