Skip to content

Commit e441835

Browse files
berrangebonzini
authored andcommitted
tools/virtiofsd: add G_GNUC_PRINTF for logging functions
Signed-off-by: Daniel P. Berrangé <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent d62449d commit e441835

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

tools/virtiofsd/fuse_log.c

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "fuse_log.h"
1313

1414

15+
G_GNUC_PRINTF(2, 0)
1516
static void default_log_func(__attribute__((unused)) enum fuse_log_level level,
1617
const char *fmt, va_list ap)
1718
{

tools/virtiofsd/fuse_log.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ enum fuse_log_level {
4545
* @param ap format string arguments
4646
*/
4747
typedef void (*fuse_log_func_t)(enum fuse_log_level level, const char *fmt,
48-
va_list ap);
48+
va_list ap)
49+
G_GNUC_PRINTF(2, 0);
4950

5051
/**
5152
* Install a custom log handler function.
@@ -68,6 +69,7 @@ void fuse_set_log_func(fuse_log_func_t func);
6869
* @param level severity level (FUSE_LOG_ERR, FUSE_LOG_DEBUG, etc)
6970
* @param fmt sprintf-style format string including newline
7071
*/
71-
void fuse_log(enum fuse_log_level level, const char *fmt, ...);
72+
void fuse_log(enum fuse_log_level level, const char *fmt, ...)
73+
G_GNUC_PRINTF(2, 3);
7274

7375
#endif /* FUSE_LOG_H_ */

tools/virtiofsd/passthrough_ll.c

+1
Original file line numberDiff line numberDiff line change
@@ -4182,6 +4182,7 @@ static void setup_nofile_rlimit(unsigned long rlimit_nofile)
41824182
}
41834183
}
41844184

4185+
G_GNUC_PRINTF(2, 0)
41854186
static void log_func(enum fuse_log_level level, const char *fmt, va_list ap)
41864187
{
41874188
g_autofree char *localfmt = NULL;

0 commit comments

Comments
 (0)