Skip to content

Commit b6f9382

Browse files
authored
Merge pull request simdjson#972 from simdjson/jkeiser/effc++
Compile with -Weffc++ in CI
2 parents 843b73d + d9929ed commit b6f9382

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

cmake/simdjson-flags.cmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ if(MSVC)
6060
target_compile_options(simdjson-internal-flags INTERFACE /WX /W3 /sdl)
6161
else()
6262
target_compile_options(simdjson-internal-flags INTERFACE -fPIC)
63-
if (NOT SIMDJSON_GOOGLE_BENCHMARKS) # Google Benchmark can't be compiled without warnings with -Weffc++
64-
target_compile_options(simdjson-internal-flags INTERFACE -Weffc++)
65-
endif()
66-
target_compile_options(simdjson-internal-flags INTERFACE -Werror -Wall -Wextra -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion)
63+
target_compile_options(simdjson-internal-flags INTERFACE -Werror -Wall -Wextra -Weffc++)
64+
target_compile_options(simdjson-internal-flags INTERFACE -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion)
6765
endif()
6866

6967
# Optional flags

include/simdjson/common_defs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024;
117117
SIMDJSON_DISABLE_GCC_WARNING(-Wextra) \
118118
SIMDJSON_DISABLE_GCC_WARNING(-Wattributes) \
119119
SIMDJSON_DISABLE_GCC_WARNING(-Wimplicit-fallthrough) \
120+
SIMDJSON_DISABLE_GCC_WARNING(-Wnon-virtual-dtor) \
120121
SIMDJSON_DISABLE_GCC_WARNING(-Wreturn-type) \
121122
SIMDJSON_DISABLE_GCC_WARNING(-Wshadow) \
122123
SIMDJSON_DISABLE_GCC_WARNING(-Wunused-parameter) \

tools/json2json.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#include <iostream>
22
#include <unistd.h>
33
#include "simdjson.h"
4+
5+
SIMDJSON_PUSH_DISABLE_ALL_WARNINGS
46
#ifndef __cpp_exceptions
57
#define CXXOPTS_NO_EXCEPTIONS
68
#endif
79
#include "cxxopts.hpp"
10+
SIMDJSON_POP_DISABLE_WARNINGS
811

912
int main(int argc, char *argv[]) {
1013
#ifdef __cpp_exceptions

tools/jsonstats.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
#include <set>
33

44
#include "simdjson.h"
5+
6+
SIMDJSON_PUSH_DISABLE_ALL_WARNINGS
57
#ifndef __cpp_exceptions
68
#define CXXOPTS_NO_EXCEPTIONS
79
#endif
810
#include "cxxopts.hpp"
11+
SIMDJSON_POP_DISABLE_WARNINGS
912

1013
size_t count_nonasciibytes(const uint8_t *input, size_t length) {
1114
size_t count = 0;

tools/minify.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55
#include <unistd.h>
66

77
#include "simdjson.h"
8+
9+
SIMDJSON_PUSH_DISABLE_ALL_WARNINGS
810
#ifndef __cpp_exceptions
911
#define CXXOPTS_NO_EXCEPTIONS
1012
#endif
1113
#include "cxxopts.hpp"
14+
SIMDJSON_POP_DISABLE_WARNINGS
1215

1316
cxxopts::Options options("minify", "Runs the parser against the given json files in a loop, measuring speed and other statistics.");
1417

0 commit comments

Comments
 (0)