diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-07-22 15:11:32 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-07-22 23:14:43 +0000 |
commit | fc70c4f862972305a07b206c86c84d3e67e4ec81 (patch) | |
tree | 1004e6ce5f800e48c2d95a3c4d4e642c44b2dd84 /tools | |
parent | 234eeabe2f7acc6896d02968eeaab9882f8ac56f (diff) | |
download | libinput-fc70c4f862972305a07b206c86c84d3e67e4ec81.tar.gz |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libinput-quirks.c | 3 | ||||
-rw-r--r-- | tools/libinput-record.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/tools/libinput-quirks.c b/tools/libinput-quirks.c index 434bca3f..173e5c22 100644 --- a/tools/libinput-quirks.c +++ b/tools/libinput-quirks.c @@ -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 diff --git a/tools/libinput-record.c b/tools/libinput-record.c index b12132fc..8ed14b5d 100644 --- a/tools/libinput-record.c +++ b/tools/libinput-record.c @@ -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); |