diff options
| author | Alexandre Ganea <alex_toresh@yahoo.fr> | 2024-01-02 18:24:07 -0500 |
|---|---|---|
| committer | Alexandre Ganea <alex_toresh@yahoo.fr> | 2024-01-17 07:23:56 -0500 |
| commit | 92f91dde6975a09830a3453f94f05452789c952f (patch) | |
| tree | f5232017092a747c00ca9562e4cc3ba369933b84 /third-party | |
| parent | 63a3c4cc85066a5fc44ae7f55d5b42a5708b9724 (diff) | |
[third-party] Silence warning on benchmark when building with Clang ToT
fixes:
```
[7409/7446] Building CXX object third-party\benchmark\src\CMakeFiles\benchmark.dir\benchmark.cc.obj
C:\git\llvm-project\third-party\benchmark\src\benchmark.cc(172,17): warning: offset of on non-standard-layout type 'State' [-Winvalid-offsetof]
172 | static_assert(offsetof(State, error_occurred_) <=
| ^ ~~~~~~~~~~~~~~~
C:\git\llvm_package_18.0.0\build64_stage0\lib\clang\18\include\__stddef_offsetof.h(11,24): note: expanded from macro 'offsetof'
11 | #define offsetof(t, d) __builtin_offsetof(t, d)
| ^ ~
1 warning generated.
```
Diffstat (limited to 'third-party')
| -rw-r--r-- | third-party/benchmark/src/benchmark.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/third-party/benchmark/src/benchmark.cc b/third-party/benchmark/src/benchmark.cc index cedeee31c79e..473151136202 100644 --- a/third-party/benchmark/src/benchmark.cc +++ b/third-party/benchmark/src/benchmark.cc @@ -166,6 +166,9 @@ State::State(IterationCount max_iters, const std::vector<int64_t>& ranges, #elif defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Winvalid-offsetof" +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Winvalid-offsetof" #endif // Offset tests to ensure commonly accessed data is on the first cache line. const int cache_line_size = 64; @@ -176,6 +179,8 @@ State::State(IterationCount max_iters, const std::vector<int64_t>& ranges, #pragma warning pop #elif defined(__GNUC__) #pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop #endif } |
