diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2023-01-26 14:53:47 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2023-01-27 12:01:20 +0100 |
| commit | c84e51870940311bb6ec67d8b192da1ce32cba8f (patch) | |
| tree | 5d1c214da53ca54b575e0b9e7c66d3c2422b1751 /lib/zlog.c | |
| parent | 0f9de11a11644b77cc60d6ff6ac4519d2e5c29e1 (diff) | |
*: no-warn pragmas for non-const format strings
We do use non-constant/literal format strings in a few places for more
or less valid reasons; put `ignored "-Wformat-nonliteral"` around those
so we can have the warning enabled for everywhere else.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/zlog.c')
| -rw-r--r-- | lib/zlog.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/zlog.c b/lib/zlog.c index 6a36a0b123..e08d22b2b9 100644 --- a/lib/zlog.c +++ b/lib/zlog.c @@ -743,7 +743,11 @@ const char *zlog_msg_text(struct zlog_msg *msg, size_t *textlen) fb.outpos_i = 0; va_copy(args, msg->args); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + /* format-string checking is done further up the chain */ need += vbprintfrr(&fb, msg->fmt, args); +#pragma GCC diagnostic pop va_end(args); msg->textlen = need; @@ -762,7 +766,11 @@ const char *zlog_msg_text(struct zlog_msg *msg, size_t *textlen) fb.outpos_i = 0; va_copy(args, msg->args); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + /* same as above */ vbprintfrr(&fb, msg->fmt, args); +#pragma GCC diagnostic pop va_end(args); bputch(&fb, '\n'); |
