[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/6] tools/virtiofsd: add G_GNUC_PRINTF for logging functions
From: |
Daniel P . Berrangé |
Subject: |
[PATCH 3/6] tools/virtiofsd: add G_GNUC_PRINTF for logging functions |
Date: |
Mon, 19 Dec 2022 08:02:02 -0500 |
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
tools/virtiofsd/fuse_log.c | 1 +
tools/virtiofsd/fuse_log.h | 6 ++++--
tools/virtiofsd/passthrough_ll.c | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/virtiofsd/fuse_log.c b/tools/virtiofsd/fuse_log.c
index 745d88cd2a..2de3f48ee7 100644
--- a/tools/virtiofsd/fuse_log.c
+++ b/tools/virtiofsd/fuse_log.c
@@ -12,6 +12,7 @@
#include "fuse_log.h"
+G_GNUC_PRINTF(2, 0)
static void default_log_func(__attribute__((unused)) enum fuse_log_level level,
const char *fmt, va_list ap)
{
diff --git a/tools/virtiofsd/fuse_log.h b/tools/virtiofsd/fuse_log.h
index 8d7091bd4d..e5c2967ab9 100644
--- a/tools/virtiofsd/fuse_log.h
+++ b/tools/virtiofsd/fuse_log.h
@@ -45,7 +45,8 @@ enum fuse_log_level {
* @param ap format string arguments
*/
typedef void (*fuse_log_func_t)(enum fuse_log_level level, const char *fmt,
- va_list ap);
+ va_list ap)
+ G_GNUC_PRINTF(2, 0);
/**
* Install a custom log handler function.
@@ -68,6 +69,7 @@ void fuse_set_log_func(fuse_log_func_t func);
* @param level severity level (FUSE_LOG_ERR, FUSE_LOG_DEBUG, etc)
* @param fmt sprintf-style format string including newline
*/
-void fuse_log(enum fuse_log_level level, const char *fmt, ...);
+void fuse_log(enum fuse_log_level level, const char *fmt, ...)
+ G_GNUC_PRINTF(2, 3);
#endif /* FUSE_LOG_H_ */
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index 20f0f41f99..40ea2ed27f 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -4182,6 +4182,7 @@ static void setup_nofile_rlimit(unsigned long
rlimit_nofile)
}
}
+G_GNUC_PRINTF(2, 0)
static void log_func(enum fuse_log_level level, const char *fmt, va_list ap)
{
g_autofree char *localfmt = NULL;
--
2.38.1
- [PATCH 0/6] enforce use of G_GNUC_PRINTF annotations, Daniel P . Berrangé, 2022/12/19
- [PATCH 6/6] enforce use of G_GNUC_PRINTF attributes, Daniel P . Berrangé, 2022/12/19
- [PATCH 3/6] tools/virtiofsd: add G_GNUC_PRINTF for logging functions,
Daniel P . Berrangé <=
- [PATCH 1/6] disas: add G_GNUC_PRINTF to gstring_printf, Daniel P . Berrangé, 2022/12/19
- [PATCH 4/6] util/error: add G_GNUC_PRINTF for various functions, Daniel P . Berrangé, 2022/12/19
- [PATCH 5/6] tests: add G_GNUC_PRINTF for various functions, Daniel P . Berrangé, 2022/12/19
- [PATCH 2/6] hw/xen: use G_GNUC_PRINTF/SCANF for various functions, Daniel P . Berrangé, 2022/12/19
- Re: [PATCH 0/6] enforce use of G_GNUC_PRINTF annotations, Paolo Bonzini, 2022/12/22