Suppress invalid-offsetof warning for clang (#1821)

For several compilers, `benchmark.cc` suppresses a warning regarding its use of `offsetof`. This merely extends that suppression to cover clang as well.
This commit is contained in:
Devon Loehr 2024-07-24 08:12:04 -04:00 committed by GitHub
parent df44bf7187
commit fa236ed6e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -207,7 +207,7 @@ State::State(std::string name, IterationCount max_iters,
#if defined(__INTEL_COMPILER)
#pragma warning push
#pragma warning(disable : 1875)
#elif defined(__GNUC__)
#elif defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winvalid-offsetof"
#endif
@ -225,7 +225,7 @@ State::State(std::string name, IterationCount max_iters,
offsetof(State, skipped_) <= (cache_line_size - sizeof(skipped_)), "");
#if defined(__INTEL_COMPILER)
#pragma warning pop
#elif defined(__GNUC__)
#elif defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
#if defined(__NVCC__)