BENCHMARK_ENABLE_WERROR=Off should also disable -pedantic-errors (#2183)
Otherwise Clang 22 builds fail with:
```
/build/_deps/benchmark-src/include/benchmark/benchmark.h:1442:30: error: '__COUNTER__' is a C2y extension [-Werror,-Wc2y-extensions]
1442 | #if defined(__COUNTER__) && (__COUNTER__ + 1 == __COUNTER__ + 0)
| ^
```diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae02e77..d27698a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -205,13 +205,13 @@
add_cxx_compiler_flag(-Wformat=2)
if(BENCHMARK_ENABLE_WERROR)
add_cxx_compiler_flag(-Werror)
+ add_cxx_compiler_flag(-pedantic-errors)
endif()
if (NOT BENCHMARK_ENABLE_TESTING)
# Disable warning when compiling tests as gtest does not use 'override'.
add_cxx_compiler_flag(-Wsuggest-override)
endif()
add_cxx_compiler_flag(-pedantic)
- add_cxx_compiler_flag(-pedantic-errors)
add_cxx_compiler_flag(-Wshorten-64-to-32)
add_cxx_compiler_flag(-fstrict-aliasing)
# Disable warnings regarding deprecated parts of the library while building