4 * Copyright (C) 2011 Dan Carpenter.
6 * Licensed under the Open Software License version 1.1
14 static void match_assign(struct expression
*expr
)
24 macro
= get_macro_name(expr
->pos
);
27 if (strcmp(macro
, "min_t"))
30 if (!get_absolute_max(expr
->left
, &max_left
))
32 if (!get_absolute_max(expr
->right
, &max_right
))
35 if (max_left
>= max_right
)
38 name
= get_variable_from_expr_complex(expr
->right
, NULL
);
39 sm_msg("warn: min_t truncates here '%s' (%lld vs %lld)", name
, max_left
, max_right
);
43 void check_min_t(int id
)
46 if (option_project
!= PROJ_KERNEL
)
48 add_hook(&match_assign
, ASSIGNMENT_HOOK
);