summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-20 14:09:47 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-04-20 14:42:43 -0400
commit032b75419d7ad6cab188d1ff5c5d1d322eff1171 (patch)
treee93d0fe2cf168b3c8e42c63b04261730e61917ed /src/core
parent40591b418327aa1579de9f10fd1c50f3927ecb33 (diff)
basic/log: fix _printf_ annotation on log_object_internalv
Fixup for 4b58153dd22172d817055d2a09a0cdf3f4bd9db3. I saw this because of a clang warning. With gcc the -Wformat-nonliteral warning doesn't seem to work as expected. In two places, a string constructed with strjoina is used as the pattern. This is safe, because we're taking a pattern which was already marked with _printf_ and prepending a known value to it. Those places are marked with #pragma to silence the warning.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/selinux-access.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c
index 2b96a9551b..0f8a2d68e2 100644
--- a/src/core/selinux-access.c
+++ b/src/core/selinux-access.c
@@ -135,7 +135,12 @@ _printf_(2, 3) static int log_callback(int type, const char *fmt, ...) {
fmt2 = strjoina("selinux: ", fmt);
va_start(ap, fmt);
- log_internalv(LOG_AUTH | callback_type_to_priority(type), 0, __FILE__, __LINE__, __FUNCTION__, fmt2, ap);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+ log_internalv(LOG_AUTH | callback_type_to_priority(type),
+ 0, __FILE__, __LINE__, __FUNCTION__,
+ fmt2, ap);
+#pragma GCC diagnostic pop
va_end(ap);
return 0;