xz: list: suppress -Wformat-nonliteral for Solaris

Solaris' GCC can't understand that our use is fine, unlike modern compilers:
```
list.c: In function 'print_totals_basic':
list.c:1191:4: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
  uint64_to_str(totals.files, 0));
  ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

It's presumably because of older gettext missing format attributes.

This is with `gcc (GCC) 7.3.0`.

(cherry picked from commit b69768c8bd)
This commit is contained in:
Sam James 2024-04-14 08:08:00 +01:00 committed by Lasse Collin
parent 7ce2ac795a
commit dc6b6011b4
No known key found for this signature in database
GPG Key ID: 38EE757D69184620
1 changed files with 7 additions and 0 deletions

View File

@ -1178,6 +1178,10 @@ print_totals_basic(void)
totals.uncompressed_size),
checks);
#if defined(__sun) && (defined(__GNUC__) || defined(__clang__))
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
// Since we print totals only when there are at least two files,
// the English message will always use "%s files". But some other
// languages need different forms for different plurals so we
@ -1189,6 +1193,9 @@ print_totals_basic(void)
totals.files <= ULONG_MAX ? totals.files
: (totals.files % 1000000) + 1000000),
uint64_to_str(totals.files, 0));
#if defined(__sun) && (defined(__GNUC__) || defined(__clang__))
# pragma GCC diagnostic pop
#endif
return;
}