check-cppcheck: autogen suppressions for all the list_for_each(_safe)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-03-26 11:31:58 +10:30 committed by Christian Decker
parent 0e0ad1aa4d
commit a54872063f
2 changed files with 8 additions and 0 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@
*.gcda
*.gcno
*.dSYM
.cppcheck-suppress
TAGS
ccan/tools/configurator/configurator
ccan/ccan/cdump/tools/cdump-enumstr

View File

@ -258,6 +258,13 @@ check-python:
check-includes:
@tools/check-includes.sh
# cppcheck gets confused by list_for_each(head, i, list): thinks i is uninit.
.cppcheck-suppress:
@git ls-files -- "*.c" "*.h" | grep -vE '^ccan/' | xargs grep -n 'list_for_each' | sed 's/\([^:]*:.*\):.*/uninitvar:\1/' > $@
check-cppcheck: .cppcheck-suppress
@trap 'rm -f .cppcheck-suppress' 0; git ls-files -- "*.c" "*.h" | grep -vE '^ccan/' | xargs cppcheck -q --language=c --std=c11 --error-exitcode=1 --suppressions-list=.cppcheck-suppress
check-source: check-makefile check-source-bolt check-whitespace check-markdown check-spelling check-python check-includes
full-check: check check-source