-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
The build script passes -pedantic -Werror:
Line 207 in 4e26a9e
| add_cxx_compiler_flag(-pedantic) |
However, the code relies on extensions:
benchmark/include/benchmark/benchmark.h
Line 1484 in 4e26a9e
| #if defined(__COUNTER__) && (__COUNTER__ + 1 == __COUNTER__ + 0) |
While working on implementing __COUNTER__ for C2y mode in Clang (llvm/llvm-project#162662), I've added the expected extension and pre-compat warnings, which then cause the code in benchmark.h to fail to compile because of -pedantic-errors.
There's a few ways to solve this, but I'm not familiar enough with benchmark to know which is the best way to go. You could stop using __COUNTER__ entirely and just use the __LINE__ fallback since that has to work to be a useful fallback anyway. You could stop passing -pedantic and continuing using __COUNTER__. You could use __extension__ to silence the extension warning. Other ideas likely exist.