diff options
author | Martin Pitt <martinpitt@users.noreply.github.com> | 2017-02-14 02:58:22 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-13 20:58:22 -0500 |
commit | 4a027e1935c630e71efdc829c4b72492ad25cbde (patch) | |
tree | e93c189aedb2abcc85042548ee0317944ae1ef53 /src/fstab-generator | |
parent | ae3251851aa64138f415567b0a0d0df143182803 (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.
Diffstat (limited to 'src/fstab-generator')
-rw-r--r-- | src/fstab-generator/fstab-generator.c | 3 |
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; |