summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristophe de Dinechin <dinechin@redhat.com>2018-06-26 11:04:41 +0200
committerFrediano Ziglio <fziglio@redhat.com>2018-06-26 10:25:42 +0100
commit258123318d26f88ffc8ac649155f6536e5503ba9 (patch)
treed0e038a20ffe96cd40195d8ce751713593027170 /common
parent0fc3d4209f42d673318996e3fdb8dcdadd9a465a (diff)
Add SPICE_ATTR_NORETURN on prototype of error functions
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@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
Diffstat (limited to 'common')
-rw-r--r--common/lz.h1
-rw-r--r--common/quic.h1
2 files changed, 2 insertions, 0 deletions
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, ...);