When analysing some code with cppcheck 2.2 I seem to have found a false positive. It looks like cppcheck does not recognise that the pointer is incremented and so a subsequent check is not the same as a previous one.
The following code shows that the increment actually occurs, the second conditional check of if (*ptr >= max_value) is not the same as the first one.
Hi,
When analysing some code with cppcheck 2.2 I seem to have found a false positive. It looks like cppcheck does not recognise that the pointer is incremented and so a subsequent check is not the same as a previous one.
The following code shows that the increment actually occurs, the second conditional check of
if (*ptr >= max_value)
is not the same as the first one.Any advice would be appreciated.
I should have added the output of the test, this is shown below...
Thanks! I created ticket https://trac.cppcheck.net/ticket/10004