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
;
29 case EXPR_CONDITIONAL
:
36 if (in_expression_statement())
38 sm_msg("warn: statement has no effect %d", expr
->type
);
41 void check_no_effect(int id
)
44 add_hook(&match_stmt
, STMT_HOOK
);