mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-29 23:00:08 +01:00
Silence compiler warnings for -Wformat-nonliteral
In the various logging functions where we need to modify the format argument, disable the compiler warnings. Interestingly, GCC doesn't seem to mind those but building with clang unleashes pages of warnings. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
234eeabe2f
commit
fc70c4f862
4 changed files with 15 additions and 0 deletions
|
|
@ -2191,7 +2191,10 @@ libevdev_log_func(const struct libevdev *evdev,
|
|||
|
||||
snprintf(fmt, sizeof(fmt), "%s%s", prefix, format);
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
log_msg_va(libinput, pri, fmt, args);
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
|
|
@ -775,7 +775,10 @@ evdev_log_msg(struct evdev_device *device,
|
|||
format);
|
||||
|
||||
va_start(args, format);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
log_msg_va(evdev_libinput_context(device), priority, buf, args);
|
||||
#pragma GCC diagnostic pop
|
||||
va_end(args);
|
||||
|
||||
}
|
||||
|
|
@ -810,7 +813,10 @@ evdev_log_msg_ratelimit(struct evdev_device *device,
|
|||
format);
|
||||
|
||||
va_start(args, format);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
log_msg_va(evdev_libinput_context(device), priority, buf, args);
|
||||
#pragma GCC diagnostic pop
|
||||
va_end(args);
|
||||
|
||||
if (state == RATELIMIT_THRESHOLD) {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,10 @@ log_handler(struct libinput *this_is_null,
|
|||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s: %s", prefix, format);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
vfprintf(out, buf, args);
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -210,7 +210,10 @@ iprintf(FILE *fp,
|
|||
|
||||
snprintf(fmt, sizeof(fmt), "%s%s", &space[len - indent - 1], format);
|
||||
va_start(args, format);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
||||
rc = vfprintf(fp, fmt, args);
|
||||
#pragma GCC diagnostic pop
|
||||
va_end(args);
|
||||
|
||||
assert(rc != -1 && (unsigned int)rc > indent);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue