Skip to content

Commit b1e1191

Browse files
committed
Add inline cppcheck message suppression option.
Allow extra options from environment.
1 parent 78654f1 commit b1e1191

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

scripts/cppcheck.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ fi
1313
# See if cppcheck accepts --check-level
1414
EXHAUSTIVE=$(cppcheck --check-level=exhaustive --version > /dev/null 2>&1 && echo "--check-level=exhaustive")
1515

16-
CPPCHKOPT=( -j "$nproc" --force "$EXHAUSTIVE" )
16+
CPPCHKOPT=( -j "$nproc" --force "$EXHAUSTIVE" --inline-suppr )
1717
CPPCHKOPT+=( "--enable=warning,performance,portability" )
1818
CPPCHKOPT+=( "-I$(realpath "$(dirname "$0")/../include")" )
1919

20+
if [ -n "$CPPCHECK_OPTS" ]; then
21+
read -r -a OPTS <<< "$CPPCHECK_OPTS"
22+
CPPCHKOPT+=( "${OPTS[@]}" )
23+
fi
24+
2025
# Even cppcheck 2.3 (debian 11) supports c++17 (undocumented)
2126
CCSTD=( --std=c11 --language=c )
2227
CXSTD=( --std=c++17 --language=c++ )

0 commit comments

Comments
 (0)