diff --git a/CMakeLists.txt b/CMakeLists.txt index 05de4afb..cb45a119 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,9 @@ if(MSVC) target_compile_options(simdjson-flags INTERFACE /WX /W3) else() target_compile_options(simdjson-flags INTERFACE -fPIC) + if(NOT SIMDJSON_GOOGLE_BENCHMARKS) # Google Benchmark can't be compiled without warnings with -Weffc++ + target_compile_options(simdjson-flags INTERFACE -Weffc++) + endif() target_compile_options(simdjson-flags INTERFACE -Werror -Wall -Wextra -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion) endif() diff --git a/include/simdjson/common_defs.h b/include/simdjson/common_defs.h index e461b3e9..5e6e2bf9 100644 --- a/include/simdjson/common_defs.h +++ b/include/simdjson/common_defs.h @@ -104,6 +104,7 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024; #define SIMDJSON_PUSH_DISABLE_WARNINGS _Pragma("GCC diagnostic push") // gcc doesn't seem to disable all warnings with all and extra, add warnings here as necessary #define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS SIMDJSON_PUSH_DISABLE_WARNINGS \ + SIMDJSON_DISABLE_GCC_WARNING(-Weffc++) \ SIMDJSON_DISABLE_GCC_WARNING(-Wall) \ SIMDJSON_DISABLE_GCC_WARNING(-Wconversion) \ SIMDJSON_DISABLE_GCC_WARNING(-Wextra) \