unreachable: move it out of smatch_flow.c and smatch_states.c
commit7565171e48037cbbdd748a1308cc41f95a1f335b
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 25 Apr 2014 10:25:48 +0000 (25 13:25 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 25 Apr 2014 10:25:48 +0000 (25 13:25 +0300)
tree405b6bc61f17816cc1e277036afd42739609f308
parent97e0f3a07f0a55cf6a1b279c33d533d819ece8c6
unreachable: move it out of smatch_flow.c and smatch_states.c

The unreachable code in smatch_states.c seemed important because it would
let people know when they call set_state() but nothing happened.  The
problem was that it duplicated code in smatch_flow.c so when smatch_flow.c
was enabled I turned off the warning in smatch_states.c.  which meant that
I only ever saw the warnings from smatch_flow.c and normal smatch users
only ever saw the warnings from smatch_states.c.  The code in
smatch_states.c eventually became buggy and I didn't notice.  I have
deleted it.

The code in check_unreachable.c is almost the same as the old smatch_flow.c
code except that I use a different method to find the last statement in a
function.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_list.h
check_unreachable.c [new file with mode: 0644]
smatch_flow.c
smatch_states.c