pointer_math: don't complain if a pointer math operation is within bounds
commitbc4b3becd4e420aa49b6ae6b4c15424ca9904e4e
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 16 Jul 2015 11:11:14 +0000 (16 14:11 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 16 Jul 2015 11:11:14 +0000 (16 14:11 +0300)
treeb0276f8f0d2b26671bf6f9a9f4138449a1d0b4ec
parent6eae5f4303e1db86b9ac23de3d602717060aeece
pointer_math: don't complain if a pointer math operation is within bounds

I'm trying to make the pointer math much more verbose and one of the
common false positives that I'm seeing with my new code is when we are
copying data from a char array to an array with different size elements.
It maybe looks like this:

for (i = 0; i < sizeof(char_array); i++)
other_array[i] = char_array[i];

If we know that other_array[i] doesn't write out of bounds then don't
complain.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_pointer_math.c