DigitalInBlue / Celero

C++ Benchmark Authoring Library/Framework
Other
822 stars 96 forks source link

Compiler errors with aggressive warnings enabled #140

Closed jiverson002 closed 3 years ago

jiverson002 commented 4 years ago

Compiling with Clang on MacOS and compiler options -Wall -Wextra -pedantic -Werror produces the following error:

.../include/celero/ThreadLocal.h:30:9: error: keyword is hidden by macro
      definition [-Werror,-Wkeyword-macro]
clang++ version: Apple clang version 11.0.3 (clang-1103.0.32.29)

thread_local is a C++11 keyword, so it seems that the check

https://github.com/DigitalInBlue/Celero/blob/ce3b5a33c27950fe356003b7ba886e0b2cb324f1/include/celero/ThreadLocal.h#L22

will be incorrect whenever thread_local is not defined as a macro.


Compiling with G++ on MacOS and compiler options -Wall -Wextra -pedantic -Werror produces the following error:

.../src/Memory.cpp:66:19: error: 'strlen' was not declared in this scope 
   66 |    const auto i = strlen(line); 
      |

and many more like it.

g++ version: g++-9 (Homebrew GCC 9.3.0) 9.3.0

Looks like Memory.cpp is missing #include <cstring>.