This is incorrect because there are multiple branches that call 'raw::insert' which adds values into it, and 'raw' is std::vector, so Cppcheck should be able to understand what 'insert' does.
This is incorrect because 'source_i' can be incremented multiple times during each loop round, so the outer condition is not checked every time it is incremented.
Following code reports:
This is incorrect because 'pixel_values' size is constexpr 65535 + 1 = 65536
Code:
Following code reports:
This is incorrect because 'Handle::situation' is a function and is not a member variable. 'situation' is member variable of another class.
Code:
Following code reports:
This is incorrect because there are multiple branches that call 'raw::insert' which adds values into it, and 'raw' is std::vector, so Cppcheck should be able to understand what 'insert' does.
Code:
Following code reports:
This is incorrect because 'source_i' can be incremented multiple times during each loop round, so the outer condition is not checked every time it is incremented.
Code:
Last edit: Ville 2025-03-19
Issue 1 is fixed in 2.18dev.
Issue 2: https://trac.cppcheck.net/ticket/13725
Issue 3: https://trac.cppcheck.net/ticket/13727
Thanks for reporting, issue 4: https://trac.cppcheck.net/ticket/13728