2 * sparse/check_no_effect.c
4 * Copyright (C) 2010 Dan Carpenter.
6 * Licensed under the Open Software License version 1.1
14 static void match_stmt(struct statement
*stmt
)
16 struct expression
*expr
;
18 if (stmt
->type
!= STMT_EXPRESSION
)
20 expr
= stmt
->expression
;
33 case EXPR_CONDITIONAL
:
40 if (in_expression_statement())
42 sm_msg("warn: statement has no effect %d", expr
->type
);
45 void check_no_effect(int id
)
48 add_hook(&match_stmt
, STMT_HOOK
);