I have come across this problem that seems like cppcheck just isn't understanding the flow of the if statement. It is showing that memset is getting a -1 value but that else statement should never be accessed for the case when src is > tgt. Obviously this code is a reduced variation of what is actually going on. But it seems to be the smallest piece of code that demonstrates the behavior.
I have come across this problem that seems like cppcheck just isn't understanding the flow of the if statement. It is showing that memset is getting a -1 value but that else statement should never be accessed for the case when src is > tgt. Obviously this code is a reduced variation of what is actually going on. But it seems to be the smallest piece of code that demonstrates the behavior.
I can reproduce this with v2.3.
I have created a ticket: https://trac.cppcheck.net/ticket/10157