This patch disables the -Winvalid-offsetof warning for GCC and Clang when using it to check the cache lines of the State object. Technically this usage of offsetof is undefined behavior until C++17. However, all major compilers support this application as an extension, as demonstrated by the passing static assert (If a compiler encounters UB during evaluation of a constant expression, that UB must be diagnosed). Unfortunately, Clang and GCC also produce a warning about it. This patch temporarily suppresses the warning using #pragma's in the source file (instead of globally suppressing the warning in the build systems). This way the warning is ignored for both CMake and Bazel builds without having to modify either build system.
| Name |
Last commit
|
Last update |
|---|---|---|
| bazel | Loading commit data... | |
| cmake | Loading commit data... | |
| docs | Loading commit data... | |
| include/benchmark | Loading commit data... | |
| src | Loading commit data... | |
| test | Loading commit data... | |
| tools | Loading commit data... | |
| .clang-format | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .travis-libcxx-setup.sh | Loading commit data... | |
| .travis.yml | Loading commit data... | |
| .ycm_extra_conf.py | Loading commit data... | |
| AUTHORS | Loading commit data... | |
| BUILD.bazel | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CONTRIBUTING.md | Loading commit data... | |
| CONTRIBUTORS | Loading commit data... | |
| LICENSE | Loading commit data... | |
| README.md | Loading commit data... | |
| WORKSPACE | Loading commit data... | |
| appveyor.yml | Loading commit data... | |
| mingw.py | Loading commit data... | |
| releasing.md | Loading commit data... |