Run -Weffc++ in CI

This commit is contained in:
John Keiser 2020-06-23 13:44:25 -07:00
parent 843b73dedb
commit d9929edbc1
5 changed files with 12 additions and 4 deletions

View File

@ -60,10 +60,8 @@ if(MSVC)
target_compile_options(simdjson-internal-flags INTERFACE /WX /W3 /sdl)
else()
target_compile_options(simdjson-internal-flags INTERFACE -fPIC)
if (NOT SIMDJSON_GOOGLE_BENCHMARKS) # Google Benchmark can't be compiled without warnings with -Weffc++
target_compile_options(simdjson-internal-flags INTERFACE -Weffc++)
endif()
target_compile_options(simdjson-internal-flags INTERFACE -Werror -Wall -Wextra -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion)
target_compile_options(simdjson-internal-flags INTERFACE -Werror -Wall -Wextra -Weffc++)
target_compile_options(simdjson-internal-flags INTERFACE -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion)
endif()
# Optional flags

View File

@ -117,6 +117,7 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024;
SIMDJSON_DISABLE_GCC_WARNING(-Wextra) \
SIMDJSON_DISABLE_GCC_WARNING(-Wattributes) \
SIMDJSON_DISABLE_GCC_WARNING(-Wimplicit-fallthrough) \
SIMDJSON_DISABLE_GCC_WARNING(-Wnon-virtual-dtor) \
SIMDJSON_DISABLE_GCC_WARNING(-Wreturn-type) \
SIMDJSON_DISABLE_GCC_WARNING(-Wshadow) \
SIMDJSON_DISABLE_GCC_WARNING(-Wunused-parameter) \

View File

@ -1,10 +1,13 @@
#include <iostream>
#include <unistd.h>
#include "simdjson.h"
SIMDJSON_PUSH_DISABLE_ALL_WARNINGS
#ifndef __cpp_exceptions
#define CXXOPTS_NO_EXCEPTIONS
#endif
#include "cxxopts.hpp"
SIMDJSON_POP_DISABLE_WARNINGS
int main(int argc, char *argv[]) {
#ifdef __cpp_exceptions

View File

@ -2,10 +2,13 @@
#include <set>
#include "simdjson.h"
SIMDJSON_PUSH_DISABLE_ALL_WARNINGS
#ifndef __cpp_exceptions
#define CXXOPTS_NO_EXCEPTIONS
#endif
#include "cxxopts.hpp"
SIMDJSON_POP_DISABLE_WARNINGS
size_t count_nonasciibytes(const uint8_t *input, size_t length) {
size_t count = 0;

View File

@ -5,10 +5,13 @@
#include <unistd.h>
#include "simdjson.h"
SIMDJSON_PUSH_DISABLE_ALL_WARNINGS
#ifndef __cpp_exceptions
#define CXXOPTS_NO_EXCEPTIONS
#endif
#include "cxxopts.hpp"
SIMDJSON_POP_DISABLE_WARNINGS
cxxopts::Options options("minify", "Runs the parser against the given json files in a loop, measuring speed and other statistics.");