From: Stefan Weil via <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Cc: "Stefan Hajnoczi" <stefanha@gmail.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Stefan Weil" <sw@weilnetz.de>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PATCH v2 4/4] libvhost-user: Add format attribute to local function vu_panic
Date: Sat, 5 Nov 2022 11:24:48 +0100 [thread overview]
Message-ID: <20221105102448.436469-5-sw@weilnetz.de> (raw)
In-Reply-To: <20221105102448.436469-1-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 80f9952e71..d6ee6e7d91 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.30.2
prev parent reply other threads:[~2022-11-05 10:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-05 10:24 [PATCH v2 for-7.2 0/4] libvhost-user: Add format attribute and fix format strings Stefan Weil via
2022-11-05 10:24 ` [PATCH v2 1/4] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM) Stefan Weil via
2022-11-05 10:24 ` [PATCH v2 2/4] libvhost-user: Fix format strings Stefan Weil via
2022-11-05 10:24 ` [PATCH v2 3/4] libvhost-user: Fix two more " Stefan Weil via
2022-11-05 11:06 ` Stefan Weil via
2022-11-15 7:25 ` [PATCH for-7.2 " Stefan Weil via
2022-11-23 6:35 ` Stefan Weil via
2022-11-23 6:49 ` Stefan Weil via
2022-11-23 6:52 ` Michael S. Tsirkin
2022-11-05 10:24 ` Stefan Weil via [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221105102448.436469-5-sw@weilnetz.de \
--to=qemu-devel@nongnu.org \
--cc=laurent@vivier.eu \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-trivial@nongnu.org \
--cc=stefanha@gmail.com \
--cc=sw@weilnetz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).