summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-20 18:18:32 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-20 18:18:32 +0100
commitbcfce235a3d757f0ec3b0c01e8583382db1adfe2 (patch)
tree78a0c2102a7b0db526c01abeb352e77e708f418e /src/journal
parentbeb999379ced9e8d765e533e43d35aab11aa5c39 (diff)
macro: introduce a nice macro for disabling -Wformat-nonliteral temporarily
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/microhttpd-util.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/journal/microhttpd-util.c b/src/journal/microhttpd-util.c
index c45d0df722..3844f7a03c 100644
--- a/src/journal/microhttpd-util.c
+++ b/src/journal/microhttpd-util.c
@@ -27,14 +27,15 @@
#include "macro.h"
#include "util.h"
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
void microhttpd_logger(void *arg, const char *fmt, va_list ap) {
- _cleanup_free_ char *f;
+ _cleanup_free_ char *f = NULL;
+
if (asprintf(&f, "microhttpd: %s", fmt) <= 0) {
log_oom();
return;
}
+
+ DISABLE_WARNING_FORMAT_NONLITERAL;
log_metav(LOG_INFO, NULL, 0, NULL, f, ap);
+ REENABLE_WARNING;
}
-#pragma GCC diagnostic pop