mirror of
https://github.com/TokTok/c-toxcore
synced 2026-10-12 02:28:14 +00:00
cleanup: Enable most cppcheck warnings as errors.
Cleaned up some of the warnings it gives. Disabled the ones that are less useful for us at this time.
This commit is contained in:
@@ -6,9 +6,29 @@ SKIP_GTEST=1
|
||||
|
||||
set -e
|
||||
|
||||
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")
|
||||
|
||||
run() {
|
||||
echo "Running cppcheck in variant '$*'"
|
||||
cppcheck amalgamation.cc "${CPPFLAGS[@]}" "$@"
|
||||
cppcheck "${CPPCHECK[@]}" amalgamation.cc "${CPPFLAGS[@]}" "$@"
|
||||
}
|
||||
|
||||
. other/analysis/variants.sh
|
||||
|
||||
Reference in New Issue
Block a user