There might be some little detail in your code that confuses Cppcheck.. personally I would suggest that you repeat this procedure below until you have a small code example:
remove/simplify some piece of code
run cppcheck
if error is not written by cppcheck , undo step 1
repeat
Last edit: Daniel Marjamäki 2023-06-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
as I am new to cppcheck I am not sure this is a false positive or an error in my code...
my unit test is
cppcheck complains
but in the sensorCollection class there is a straightforward braced initialization of this memberVariable
using cppcheck from within PlatformIO, and it is version 2.7
Can you provide some little example code that reproduces the error?
It sounds like a false positive to me.
I can't reproduce with this code:
There might be some little detail in your code that confuses Cppcheck.. personally I would suggest that you repeat this procedure below until you have a small code example:
Last edit: Daniel Marjamäki 2023-06-18