Skip to content

Commit

Permalink
Workaround cppcheck ignoring -i libpromises/cf3lex.c
Browse files Browse the repository at this point in the history
When running cppcheck in static checks, we use `-i
libpromises/cf3lex.c` in order to make cppcheck ignore the
generated cf3lex.c file. However, the new version of cppcheck
ignores this option and fails on issues found in the file.

However, we don't want this file or any other generated files
except for bootstrap.inc which contains the bootstrap policy. So
we can run `make clean` and `make -C libpromise/ boostrap.inc`
before running cppcheck to get a cleaner environment.

(cherry picked from commit e9cfa41)
Signed-off-by: Lars Erik Wik <[email protected]>
  • Loading branch information
vpodzime authored and larsewi committed Oct 11, 2024
1 parent f40479b commit b12c411
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/static-check/run_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ function check_with_clang() {

function check_with_cppcheck() {
rm -f config.cache
make clean
make -C libpromises/ bootstrap.inc # needed by libpromises/bootstrap.c
./configure -C --enable-debug

# cppcheck options:
Expand Down

0 comments on commit b12c411

Please sign in to comment.