mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
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.
This commit is contained in:
parent
f2192d13b5
commit
3e2b345cfd
1 changed files with 9 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue