2 * smatch/check_assign_vs_compare.c
4 * Copyright (C) 2012 Oracle.
6 * Licensed under the Open Software License version 1.1
14 static void match_condition(struct expression
*expr
)
18 if (expr
->type
!= EXPR_ASSIGNMENT
|| expr
->op
!= '=')
21 if (!get_value(expr
->right
, &val
))
23 sm_msg("warn: was '== %s' instead of '='", sval_to_str(val
));
26 void check_assign_vs_compare(int id
)
29 add_hook(&match_condition
, CONDITION_HOOK
);