diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0bbf8c7..c4390e9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -135,6 +135,8 @@ function(configure_gcc_or_clang_gcc_options) -Wtype-limits -Wshift-negative-value -Walloca + -Wdate-time + -Wdouble-promotion -Werror -pedantic-errors ) @@ -170,7 +172,6 @@ function(configure_gcc_or_clang_gcc_options) -Wshift-sign-overflow -Wshorten-64-to-32 -Wthread-safety - -Wnull-pointer-arithmetic -Wnullable-to-nonnull-conversion -Wsometimes-uninitialized -Wstatic-in-inline @@ -183,6 +184,50 @@ function(configure_gcc_or_clang_gcc_options) -Wimplicit -Wimplicit-fallthrough -Winconsistent-missing-destructor-override + -Wabstract-vbase-init + -Warc-repeated-use-of-weak + -Wassign-enum + -Watomic-properties + -Watomic-implicit-seq-cst + -Wbad-function-cast + -Wbind-to-temporary-copy + -Wcast-function-type + -Wcomma + -Wc++-compat + -Wcalled-once-parameter + -Wcompound-token-split + -Wconditional-uninitialized + -Wconsumed + -Wdeprecated-implementations + -Wdirect-ivar-access + -Wdisabled-macro-expansion + # -Wdocumentation # TODO: + -Wdtor-name + -Wduplicate-decl-specifier + -Wduplicate-enum + -Wduplicate-method-arg + -Wduplicate-method-match + -Wexpansion-to-defined # enabled by the -Wextra on gcc + -Wexplicit-ownership-type + -Wloop-analysis + -Wextra-semi + -Wextra-semi-stmt + -Wheader-hygiene + -Wimplicit-retain-self + -Wimport-preprocessor-directive-pedantic + -Winvalid-or-nonexistent-directory + -Wmain # enabled by the -Wpedantic on gcc + -Wmethod-signatures + -Wmicrosoft + -Wnarrowing # enabled by the -Wpedantic on gcc + -Wnewline-eof + -Wover-aligned + -Woverriding-method-mismatch + -Wunguarded-availability + -Wunused-member-function + -Wused-but-marked-unused + -Wvector-conversion + -Wvla -fcolor-diagnostics -fansi-escape-codes -ftemplate-backtrace-limit=0) @@ -191,11 +236,6 @@ function(configure_gcc_or_clang_gcc_options) ${LOCAL_FN_TEST_CXX_COMPILE_OPTIONS} -Wframe-address) endif() - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0) - set(LOCAL_FN_TEST_CXX_COMPILE_OPTIONS - ${LOCAL_FN_TEST_CXX_COMPILE_OPTIONS} - -Wnull-pointer-subtraction) - endif() if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0.0) set(LOCAL_FN_TEST_CXX_COMPILE_OPTIONS ${LOCAL_FN_TEST_CXX_COMPILE_OPTIONS} @@ -226,13 +266,27 @@ function(configure_gcc_or_clang_gcc_options) set(LOCAL_FN_TEST_C_COMPILE_OPTIONS ${LOCAL_FN_TEST_C_COMPILE_OPTIONS} -Wwrite-strings - -Wbad-function-cast -Wint-conversion ) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0.0) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set(LOCAL_FN_TEST_C_COMPILE_OPTIONS ${LOCAL_FN_TEST_C_COMPILE_OPTIONS} - -fanalyzer + -Wincompatible-pointer-types # TODO: may be turned on by -Wpedantic ? + -Wbad-function-cast # added on the C++ stage if Clang is used + ) + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0.0) + set(LOCAL_FN_TEST_C_COMPILE_OPTIONS + ${LOCAL_FN_TEST_C_COMPILE_OPTIONS} + -fanalyzer + ) + endif() + endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(LOCAL_FN_TEST_C_COMPILE_OPTIONS + ${LOCAL_FN_TEST_C_COMPILE_OPTIONS} + -Wc11-extensions + -Wc23-compat + -Wc23-extensions ) endif() # Flags for C++ only @@ -249,6 +303,12 @@ function(configure_gcc_or_clang_gcc_options) ) endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0.0) + set(LOCAL_FN_TEST_CXX_COMPILE_OPTIONS + ${LOCAL_FN_TEST_CXX_COMPILE_OPTIONS} + -Wcomma-subscript + -Wregister + -Wchanges-meaning + ) set(LOCAL_FN_TEST_CXX_COMPILE_OPTIONS ${LOCAL_FN_TEST_CXX_COMPILE_OPTIONS} -fanalyzer diff --git a/tests/run_codechecker.sh b/tests/run_codechecker.sh index d7ecb04..f829f23 100755 --- a/tests/run_codechecker.sh +++ b/tests/run_codechecker.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -set -e - build_dir=cmake-build-codechecker cmake_build_dir=cmake-build-dir