diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2024-02-14 21:11:49 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2024-02-14 21:12:58 +0200 |
commit | 5394a1665b7a108a54cb8b4ef3ebe59d3dbcca3a (patch) | |
tree | a005b48ec9f12ecb84e3da5cae6cd4f2cb1430d0 | |
parent | Tests: tuktest.h: Add a missing word to a comment. (diff) | |
download | xz-5394a1665b7a108a54cb8b4ef3ebe59d3dbcca3a.tar.xz |
Tests: tuktest.h: Treat Clang separately from GCC.
Don't assume that Clang defines __GNUC__ as the extensions
are available in clang-cl as well (and possibly in some other
Clang variants?).
-rw-r--r-- | tests/tuktest.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/tuktest.h b/tests/tuktest.h index 5a8a9169..12abd532 100644 --- a/tests/tuktest.h +++ b/tests/tuktest.h @@ -4,7 +4,7 @@ // /// \file tuktest.h /// \brief Helper macros for writing simple test programs -/// \version 2023-01-08 +/// \version 2024-02-14 /// /// Some inspiration was taken from Seatest by Keith Nicholas and /// from STest which is a fork of Seatest by Jia Tan. @@ -155,14 +155,14 @@ // This is silencing warnings about unused functions. Not all test programs // need all functions from this header. -#if TUKTEST_GNUC_REQ(3, 0) +#if TUKTEST_GNUC_REQ(3, 0) || defined(__clang__) # define tuktest_maybe_unused __attribute__((__unused__)) #else # define tuktest_maybe_unused #endif // We need printf("") so silence the warning about empty format string. -#if TUKTEST_GNUC_REQ(4, 2) +#if TUKTEST_GNUC_REQ(4, 2) || defined(__clang__) # pragma GCC diagnostic ignored "-Wformat-zero-length" #endif |