cppcheck-test: add suppression of some expected warnings

This commit is contained in:
Arne Morten Kvarving 2018-08-09 10:34:01 +02:00
parent 724165b101
commit a5513e460b
4 changed files with 18 additions and 10 deletions

View File

@ -14,11 +14,19 @@ shift 2
tmpfil=`mktemp` tmpfil=`mktemp`
$cppcheck_cmd $@ --force --enable=all --suppress=unusedFunction $source_file &> $tmpfil $cppcheck_cmd $@ --force --enable=all --suppress=unusedFunction $source_file &> $tmpfil
declare -a ignorere
ignorere=(\\[/usr.*\\]
\\[.*petsc.*.h:.*\\]:.*
\\[\\*\\]
\\[.*Vec3.h:.*\\]:.*Vec[34]..has.a.constructor.with.1.argument.that.is.not.explicit.
\\[.*Tensor.h:.*\\]:.*SymmTensor..has.a.constructor.with.1.argument.that.is.not.explicit.)
nmatch=`cat $tmpfil | grep "\[.*\]" | wc -l` nmatch=`cat $tmpfil | grep "\[.*\]" | wc -l`
nsys=`cat $tmpfil | grep "\[/usr.*\]" | wc -l` for RE in ${ignorere[*]}
nnone=`cat $tmpfil | grep "\[\\*]" | wc -l` do
let "nval=$nmatch-$nsys-$nnone" nign=`cat $tmpfil | grep "$RE" | wc -l`
if test $nval -gt 0 let "nmatch=$nmatch-$nign"
done
if test $nmatch -gt 0
then then
cat $tmpfil cat $tmpfil
$cppcheck_cmd $@ -q --xml --xml-version=2 --force --enable=all --suppress=unusedFunction $source_file &> $tmpfil $cppcheck_cmd $@ -q --xml --xml-version=2 --force --enable=all --suppress=unusedFunction $source_file &> $tmpfil

View File

@ -238,10 +238,10 @@ find_program(VTFLS_COMMAND vtfls)
find_program(H5LS_COMMAND h5ls) find_program(H5LS_COMMAND h5ls)
# Generate regtest script with correct paths # Generate regtest script with correct paths
configure_file(${IFEM_REGTEST_SCRIPT} regtest.sh) configure_file(${IFEM_REGTEST_SCRIPT} regtest.sh @ONLY)
configure_file(${IFEM_CLANG_CHECK_TEST_SCRIPT} clang-check-test.sh) configure_file(${IFEM_CLANG_CHECK_TEST_SCRIPT} clang-check-test.sh @ONLY)
configure_file(${IFEM_CPPCHECK_TEST_SCRIPT} cppcheck-test.sh) configure_file(${IFEM_CPPCHECK_TEST_SCRIPT} cppcheck-test.sh @ONLY)
configure_file(${IFEM_IOTEST_SCRIPT} iotest.sh) configure_file(${IFEM_IOTEST_SCRIPT} iotest.sh @ONLY)
if(IFEM_BUILD_TESTING) if(IFEM_BUILD_TESTING)
set(EXCL_ALL) set(EXCL_ALL)

View File

@ -232,7 +232,7 @@ private:
int minNode = 0; //!< First node we own int minNode = 0; //!< First node we own
int maxNode = 0; //!< Last node we own int maxNode = 0; //!< Last node we own
const SAMpatch* sam; //!< The assembly handler the DD is constructed for. const SAMpatch* sam = nullptr; //!< The assembly handler the DD is constructed for.
}; };
#endif #endif

View File

@ -104,7 +104,7 @@ class EvalFunction : public RealFunc
public: public:
//! \brief The constructor parses the expression string. //! \brief The constructor parses the expression string.
EvalFunction(const char* function); explicit EvalFunction(const char* function);
//! \brief The destructor frees the dynamically allocated objects. //! \brief The destructor frees the dynamically allocated objects.
virtual ~EvalFunction(); virtual ~EvalFunction();