Start caring about the types a little.
This is still half arsed... :/
I created smatch_type.c with the function get_type(). The idea is that
you pass it an expression and it returns the type. "Type" in this case
mean either a ptr type or a base_type with the number of bits and
MOD_SIGNED or MOD_UNSIGNED.
Later on smatch_extra.c will take advantage of this information so that
the possible ranges can be more accurate. Right now we assume everything
is type long long.
Currently, both get_type() and get_value() ignore casts. That will have
to change.
Also I don't know anything about what get_type() should return for x + y
where x and y are different types. I guess it returns the larger type.
There are rules for this, but I don't know what they are yet. Right now
if smatch saw x + y, it would assume that x is an array... :/
check_signed.c prints a bunch of bogus stuff. I keep hoping that if
I print out information that is almost correct, then someone will do all
the work to finish it up and make it work correctly.
Signed-off-by: Dan Carpenter <error27@gmail.com>