[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/10] libvhost-user: Add format attribute to local function vu_pa
From: |
Laurent Vivier |
Subject: |
[PULL 06/10] libvhost-user: Add format attribute to local function vu_panic |
Date: |
Thu, 3 Nov 2022 17:17:23 +0100 |
From: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220422070144.1043697-4-sw@weilnetz.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
subprojects/libvhost-user/libvhost-user.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index d67953a1c39c..f7b45b3066c1 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -45,6 +45,17 @@
#include "libvhost-user.h"
/* usually provided by GLib */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#if !defined(__clang__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4)
+#define G_GNUC_PRINTF(format_idx, arg_idx) \
+ __attribute__((__format__(gnu_printf, format_idx, arg_idx)))
+#else
+#define G_GNUC_PRINTF(format_idx, arg_idx) \
+ __attribute__((__format__(__printf__, format_idx, arg_idx)))
+#endif
+#else /* !__GNUC__ */
+#define G_GNUC_PRINTF(format_idx, arg_idx)
+#endif /* !__GNUC__ */
#ifndef MIN
#define MIN(x, y) ({ \
typeof(x) _min1 = (x); \
@@ -151,7 +162,7 @@ vu_request_to_string(unsigned int req)
}
}
-static void
+static void G_GNUC_PRINTF(2, 3)
vu_panic(VuDev *dev, const char *msg, ...)
{
char *buf = NULL;
--
2.37.3
- [PULL 00/10] Trivial branch for 7.2 patches, Laurent Vivier, 2022/11/03
- [PULL 01/10] qapi: virtio: Fix the introduced version, Laurent Vivier, 2022/11/03
- [PULL 10/10] tests/unit: simpler variable sequence for test-io-channel, Laurent Vivier, 2022/11/03
- [PULL 07/10] target/m68k: Rename qregs.def -> qregs.h.inc, Laurent Vivier, 2022/11/03
- [PULL 09/10] target/tricore: Rename csfr.def -> csfr.h.inc, Laurent Vivier, 2022/11/03
- [PULL 03/10] xen/pt: fix syntax error that causes FTBFS in some configurations, Laurent Vivier, 2022/11/03
- [PULL 05/10] libvhost-user: Fix format strings, Laurent Vivier, 2022/11/03
- [PULL 08/10] target/s390x: Rename insn-data/format.def -> insn-data/format.h.inc, Laurent Vivier, 2022/11/03
- [PULL 06/10] libvhost-user: Add format attribute to local function vu_panic,
Laurent Vivier <=
- [PULL 04/10] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM), Laurent Vivier, 2022/11/03
- [PULL 02/10] Fix some typos in documentation and comments, Laurent Vivier, 2022/11/03
- Re: [PULL 00/10] Trivial branch for 7.2 patches, Stefan Hajnoczi, 2022/11/04