From: Daniel Arndt Date: Fri, 15 Jun 2018 16:43:46 +0000 (+0200) Subject: Use clang-tidy's modernize-deprecated-headers X-Git-Tag: v9.1.0-rc1~1026^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b10cf67cb9824cb64031006d738ef2c0ec373d85;p=dealii.git Use clang-tidy's modernize-deprecated-headers --- diff --git a/contrib/utilities/run_clang_tidy.sh b/contrib/utilities/run_clang_tidy.sh index 0212c9f5e5..2edc28fb02 100755 --- a/contrib/utilities/run_clang_tidy.sh +++ b/contrib/utilities/run_clang_tidy.sh @@ -46,15 +46,23 @@ echo "SRC-DIR=$SRC" ARGS="-D DEAL_II_WITH_MUPARSER=OFF -D DEAL_II_WITH_MPI=ON -D CMAKE_EXPORT_COMPILE_COMMANDS=ON @$" # disable performance-inefficient-string-concatenation because we don't care about "a"+to_string(5)+... -CHECKS="-*,mpi-*,performance-*,modernize-use-emplace,-performance-inefficient-string-concatenation" +CHECKS="-*, + mpi-*, + performance-*, + -performance-inefficient-string-concatenation, + modernize-use-emplace, + modernize-deprecated-headers" -if test -z "$(which run-clang-tidy.py)" -o -z "$(which clang++)" ; then - echo "make sure clang, clang++, and run-clang-tidy.py (part of clang) is in the path" +CHECKS="$(echo "${CHECKS}" | tr -d '[:space:]')" +echo "$CHECKS" + +if ! [ -x "$(command -v run-clang-tidy.py)" ] || ! [ -x "$(command -v clang++)" ]; then + echo "make sure clang, clang++, and run-clang-tidy.py (part of clang) are in the path" exit 2 fi CC=clang CXX=clang++ cmake "$ARGS" "$SRC" || (echo "cmake failed!"; false) || exit 2 -make expand_all_instantiations -j 4 || (echo "make expand_all_instantiations failed!"; false) || exit 3 +cmake --build . --target expand_all_instantiations || (echo "make expand_all_instantiations failed!"; false) || exit 3 run-clang-tidy.py -p . -checks="$CHECKS" -quiet -header-filter="$SRC/include/*" diff --git a/examples/step-42/step-42.cc b/examples/step-42/step-42.cc index 76fd79da01..1e890b51a0 100644 --- a/examples/step-42/step-42.cc +++ b/examples/step-42/step-42.cc @@ -78,7 +78,7 @@ // output files. The first header provides the mkdir function and // the second lets us determine what happened if mkdir fails. #include -#include +#include namespace Step42 { diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 34f8fb3731..2ee29e3386 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -49,7 +49,7 @@ #include // we use uint32_t and uint8_t below, which are declared here: -#include +#include #ifdef DEAL_II_WITH_ZLIB # include diff --git a/source/base/utilities.cc b/source/base/utilities.cc index aca7488e66..a32ba065f6 100644 --- a/source/base/utilities.cc +++ b/source/base/utilities.cc @@ -49,7 +49,7 @@ #endif #ifndef DEAL_II_MSVC -# include +# include #endif diff --git a/tests/quick_tests/adolc.cc b/tests/quick_tests/adolc.cc index 6aee1f411e..51fbab2700 100644 --- a/tests/quick_tests/adolc.cc +++ b/tests/quick_tests/adolc.cc @@ -24,7 +24,8 @@ #include #include #include -#include + +#include using namespace dealii;