From 4a027e1935c630e71efdc829c4b72492ad25cbde Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 14 Feb 2017 02:58:22 +0100 Subject: 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. --- src/fstab-generator/fstab-generator.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- cgit v1.2.3-54-g00ecf