fix: add inline exception for recent cppcheck false positive

This commit is contained in:
Michael Schmoock
2019-02-10 22:18:17 +01:00
committed by Rusty Russell
parent 5c0d658b30
commit 302a78f4eb
2 changed files with 3 additions and 1 deletions

View File

@@ -310,7 +310,7 @@ check-includes:
@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
@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 --inline-suppr
check-shellcheck:
@git ls-files -- "*.sh" | xargs shellcheck

View File

@@ -900,6 +900,8 @@ u8 *handle_channel_announcement(struct routing_state *rstate,
tal_add_destructor2(pending, destroy_pending_cannouncement, rstate);
/* Success */
// MSC: Cppcheck 1.86 gets this false positive
// cppcheck-suppress autoVariables
*scid = &pending->short_channel_id;
return NULL;