Skip to content

Commit

Permalink
fix: add inline exception for recent cppcheck false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
m-schmoock authored and rustyrussell committed Feb 18, 2019
1 parent 5c0d658 commit 302a78f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions gossipd/routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 302a78f

Please sign in to comment.