aboutsummaryrefslogtreecommitdiff
path: root/src/xz
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2023-01-11 22:46:48 +0800
committerLasse Collin <lasse.collin@tukaani.org>2023-03-11 21:37:49 +0200
commit3e2b345cfd28bdf0aabbd326254bc7246dd1125e (patch)
tree7541519c55ce6ffbe3825b6f7ce9a78cd9efada9 /src/xz
parentCMake/Windows: Add a workaround for windres from GNU binutils. (diff)
downloadxz-3e2b345cfd28bdf0aabbd326254bc7246dd1125e.tar.xz
xz: Fix warning -Wformat-nonliteral on clang in message.c.
clang and gcc differ in how they handle -Wformat-nonliteral. gcc will allow a non-literal format string as long as the function takes its format arguments as a va_list.
Diffstat (limited to '')
-rw-r--r--src/xz/message.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xz/message.c b/src/xz/message.c
index da90420f..45cc6a1f 100644
--- a/src/xz/message.c
+++ b/src/xz/message.c
@@ -723,7 +723,16 @@ vmessage(enum message_verbosity v, const char *fmt, va_list ap)
// This is a translatable string because French needs
// a space before a colon.
fprintf(stderr, _("%s: "), progname);
+
+#ifdef __clang__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif
vfprintf(stderr, fmt, ap);
+#ifdef __clang__
+# pragma GCC diagnostic pop
+#endif
+
fputc('\n', stderr);
signals_unblock();