2 * smatch/check_pointer_math.c
4 * Copyright (C) 2012 Oracle.
6 * Licensed under the Open Software License version 1.1
14 static void match_binop(struct expression
*expr
)
20 if (expr
->right
->type
!= EXPR_SIZEOF
)
22 type
= get_pointer_type(expr
->left
);
25 if (type
->bit_size
<= 8) /* ignore void, bool and char pointers*/
27 sm_msg("warn: potential pointer math issue (%d bits)", type
->bit_size
);
31 void check_pointer_math(int id
)
34 add_hook(&match_binop
, BINOP_HOOK
);