]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use clang-tidy's modernize-deprecated-headers 6768/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 15 Jun 2018 16:43:46 +0000 (18:43 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 15 Jun 2018 17:19:56 +0000 (19:19 +0200)
contrib/utilities/run_clang_tidy.sh
examples/step-42/step-42.cc
source/base/data_out_base.cc
source/base/utilities.cc
tests/quick_tests/adolc.cc

index 0212c9f5e55940bcf999edeef2d8d63113e26920..2edc28fb02ae630947ccd15728dc190a02c44226 100755 (executable)
@@ -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/*"
index 76fd79da01f695cc7e1f39f83f12ae8354499653..1e890b51a0cf80963ad7b38583d2198c7ba14a23 100644 (file)
@@ -78,7 +78,7 @@
 // output files. The first header provides the <code>mkdir</code> function and
 // the second lets us determine what happened if <code>mkdir</code> fails.
 #include <sys/stat.h>
-#include <errno.h>
+#include <cerrno>
 
 namespace Step42
 {
index 34f8fb3731c3ed000476ed9959ae80d28a885809..2ee29e3386d2f8a554c631a1367c1125397ae2a3 100644 (file)
@@ -49,7 +49,7 @@
 #include <sstream>
 
 // we use uint32_t and uint8_t below, which are declared here:
-#include <stdint.h>
+#include <cstdint>
 
 #ifdef DEAL_II_WITH_ZLIB
 #  include <zlib.h>
index aca7488e664fa51dffbe97e35b4aeeb9fcd0269c..a32ba065f604ce738dca473f81f4f4bad06da551 100644 (file)
@@ -49,7 +49,7 @@
 #endif
 
 #ifndef DEAL_II_MSVC
-#  include <stdlib.h>
+#  include <cstdlib>
 #endif
 
 
index 6aee1f411e1fcaa1d0fda30ed14b7ce07882ff80..51fbab2700376949fe010c987f11c1a201a27461 100644 (file)
@@ -24,7 +24,8 @@
 #include <adolc/adouble.h>
 #include <adolc/drivers/drivers.h>
 #include <adolc/taping.h>
-#include <math.h>
+
+#include <cmath>
 
 using namespace dealii;
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.