summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@users.noreply.github.com>2017-02-14 02:58:22 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-13 20:58:22 -0500
commit4a027e1935c630e71efdc829c4b72492ad25cbde (patch)
treee93c189aedb2abcc85042548ee0317944ae1ef53
parentae3251851aa64138f415567b0a0d0df143182803 (diff)
fstab-generator: quiesce false-positive -Werror=format-nonliteral (#5336)
Commit ae3251851 changed the fprintf() format argument into a variable which triggers a gcc 6.3 warning/error: src/fstab-generator/fstab-generator.c:243:17: error: format not a string literal, argument types not checked [-Werror=format-nonliteral] fprintf(f, format, res); This is a false positive, as the function is only being called with constant (not user-definable) arguments which are valid format strings.
-rw-r--r--src/fstab-generator/fstab-generator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index c38a5aa257..2677a3fb32 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -240,7 +240,10 @@ static int write_dependency(FILE *f, const char *opts,
res = strv_join(units, " ");
if (!res)
return log_oom();
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
fprintf(f, format, res);
+#pragma GCC diagnostic pop
}
return 0;