I think this is because checkuninitvar is has explicit handling for "=". I have a patch to modify checkuninitvar.cpp to handle the other assignment operators like "+=" and "-=". If it is useful I can submit at PR. Thanks!
-- Aaron
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
malloc() initializes buf, but not buf[0]. The following is valid because buf is never dereferenced
however, cppcheck throws
For this similar code, cppcheck correctly throws no errors
I think this is because checkuninitvar is has explicit handling for "=". I have a patch to modify checkuninitvar.cpp to handle the other assignment operators like "+=" and "-=". If it is useful I can submit at PR. Thanks!
-- Aaron
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/15005