mirror of
https://github.com/AuxXxilium/eudev.git
synced 2025-01-27 09:35:52 +07:00
Add more _printf_'s for format-nonliterals
Clang is a bit more strict wrt format-nonliterals: http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking Adding these extra printf attributes also makes gcc able to find more problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c Some parts looked intetional about breaking the format-nonliteral check. I added some supression for warnings there. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
This commit is contained in:
parent
46029d2737
commit
079a9c8229
@ -71,6 +71,7 @@
|
||||
|
||||
static int debug = 0;
|
||||
|
||||
_printf_(6,0)
|
||||
static void log_fn(struct udev *udev, int priority,
|
||||
const char *file, int line, const char *fn,
|
||||
const char *format, va_list args)
|
||||
|
@ -405,6 +405,7 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
_printf_(6,0)
|
||||
static void log_fn(struct udev *udev, int priority,
|
||||
const char *file, int line, const char *fn,
|
||||
const char *format, va_list args)
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
static bool debug;
|
||||
|
||||
_printf_(6,0)
|
||||
static void log_fn(struct udev *udev, int priority,
|
||||
const char *file, int line, const char *fn,
|
||||
const char *format, va_list args)
|
||||
|
@ -65,6 +65,7 @@ void udev_log(struct udev *udev,
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
_printf_(6,0)
|
||||
static void log_stderr(struct udev *udev,
|
||||
int priority, const char *file, int line, const char *fn,
|
||||
const char *format, va_list args)
|
||||
|
@ -67,6 +67,7 @@ static char model_enc_str[256];
|
||||
static char revision_str[16];
|
||||
static char type_str[16];
|
||||
|
||||
_printf_(6,0)
|
||||
static void log_fn(struct udev *udev, int priority,
|
||||
const char *file, int line, const char *fn,
|
||||
const char *format, va_list args)
|
||||
|
@ -73,6 +73,7 @@ static int load_module(struct udev *udev, const char *alias)
|
||||
#endif
|
||||
}
|
||||
|
||||
_printf_(6,0)
|
||||
static void udev_kmod_log(void *data, int priority, const char *file, int line,
|
||||
const char *fn, const char *format, va_list args)
|
||||
{
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
#include "udev.h"
|
||||
|
||||
_printf_(2,3)
|
||||
static int path_prepend(char **path, const char *fmt, ...)
|
||||
{
|
||||
va_list va;
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
_printf_(6,0)
|
||||
static void log_fn(struct udev *udev,
|
||||
int priority, const char *file, int line, const char *fn,
|
||||
const char *format, va_list args)
|
||||
|
Loading…
Reference in New Issue
Block a user