Skip to content

Commit

Permalink
GitHub Actions: another attempt at fixing cppcheck warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
cosinekitty committed Jul 6, 2024
1 parent aa2615e commit 99d92f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generate/run
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ cd generate || Fail "Cannot change back to generate directory."

echo ""
echo "Building C source code for 'generate' program."
CPPCHECK_OPTIONS=-I . -I novas -I vsop -I top2013 --error-exitcode=9 --enable=all --suppress=variableScope --suppress=unusedStructMember --suppress=missingIncludeSystem --suppress=unusedFunction
CPPCHECK_OPTIONS="-I . -I novas -I vsop -I top2013 --error-exitcode=9 --enable=all --suppress=variableScope --suppress=unusedStructMember --suppress=missingIncludeSystem --suppress=unusedFunction"
if [[ "${OS_NAME}" == "macOS" ]]; then
CPPCHECK_OPTIONS += --check-level=exhaustive
fi
Expand Down
6 changes: 5 additions & 1 deletion generate/unit_test_c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ Fail()
[[ "$1" == "" || "$1" == "-v" ]] || Fail "Invalid command line options."
[[ -z "${CPP}" ]] && CPP=g++

cppcheck -I ../source/c --enable=all --inline-suppr --suppress=unmatchedSuppression --suppress=variableScope --suppress=shadowFunction --suppress=unusedFunction --suppress=missingIncludeSystem --suppress=constParameterCallback --error-exitcode=9 ../source/c ../demo/c/*.c ctest.c || exit 1
CPPCHECK_OPTIONS="-I ../source/c --enable=all --inline-suppr --suppress=unmatchedSuppression --suppress=variableScope --suppress=shadowFunction --suppress=unusedFunction --suppress=missingIncludeSystem --suppress=constParameterCallback --error-exitcode=9"
if [[ "${OS_NAME}" == "macOS" ]]; then
CPPCHECK_OPTIONS += --check-level=exhaustive
fi
cppcheck ${CPPCHECK_OPTIONS} ../source/c ../demo/c/*.c ctest.c || exit 1

# Verify that the source can be built as modern C++.
${CPP} -x c++ -std=c++17 -c -Wall -Werror -O3 ../source/c/astronomy.c || Fail "Cannot compile as C++"
Expand Down

0 comments on commit 99d92f3

Please sign in to comment.