mirror of
https://github.com/google/benchmark.git
synced 2024-12-26 04:20:14 +08:00
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:
parent
df44bf7187
commit
fa236ed6e6
@ -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__)
|
||||
|
Loading…
Reference in New Issue
Block a user