2020-05-04 09:19:14 +08:00
|
|
|
#!/bin/bash
|
2018-02-23 10:22:38 +08:00
|
|
|
|
2022-01-14 08:28:06 +08:00
|
|
|
SKIP_GTEST=1
|
|
|
|
|
2018-02-23 10:22:38 +08:00
|
|
|
. other/analysis/gen-file.sh
|
|
|
|
|
2022-01-14 08:28:06 +08:00
|
|
|
set -e
|
|
|
|
|
2022-02-21 21:24:00 +08:00
|
|
|
CPPCHECK="--enable=all"
|
|
|
|
CPPCHECK+=("--inconclusive")
|
|
|
|
CPPCHECK+=("--error-exitcode=1")
|
|
|
|
# Used for VLA.
|
|
|
|
CPPCHECK+=("--suppress=allocaCalled")
|
|
|
|
# We actually write C code.
|
|
|
|
CPPCHECK+=("--suppress=cstyleCast")
|
|
|
|
# Used to enable/disable parts using if with constant condition.
|
|
|
|
CPPCHECK+=("--suppress=knownConditionTrueFalse")
|
|
|
|
# Cppcheck does not need standard library headers to get proper results.
|
|
|
|
CPPCHECK+=("--suppress=missingIncludeSystem")
|
|
|
|
# Range-for is fine.
|
|
|
|
CPPCHECK+=("--suppress=useStlAlgorithm")
|
|
|
|
# TODO(iphydf): Maybe fix?
|
|
|
|
CPPCHECK+=("--suppress=shadowArgument")
|
|
|
|
CPPCHECK+=("--suppress=shadowFunction")
|
|
|
|
CPPCHECK+=("--suppress=signConversion")
|
|
|
|
# TODO(iphydf): Fixed in the toxav refactor PR.
|
|
|
|
CPPCHECK+=("--suppress=redundantAssignment")
|
|
|
|
|
2022-01-14 08:28:06 +08:00
|
|
|
run() {
|
|
|
|
echo "Running cppcheck in variant '$*'"
|
2022-02-21 21:24:00 +08:00
|
|
|
cppcheck "${CPPCHECK[@]}" amalgamation.cc "${CPPFLAGS[@]}" "$@"
|
2022-01-14 08:28:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
. other/analysis/variants.sh
|