One of the code validation programs I use complains if I declare variables after program code (ie. call to memset() ) in a code block. If you declare both vectors and then make both calls to memset() afteward, does Cppcheck still only warn about the second use of memset()?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the report, it really looks like a false negative to me.
I created ticket 8619 for this issue and modified/reduced the code a bit but it should still show exactly the issue you detected.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Example code:
Cppcheck doesn't detect memset in line 11 - only in line 14:
One of the code validation programs I use complains if I declare variables after program code (ie. call to memset() ) in a code block. If you declare both vectors and then make both calls to memset() afteward, does Cppcheck still only warn about the second use of memset()?
It is not working either. Warns about the second use of memset only:
Thanks for the report, it really looks like a false negative to me.
I created ticket 8619 for this issue and modified/reduced the code a bit but it should still show exactly the issue you detected.
Thank you too.