I understand the awesomeness that cppcheck hardly checks syntax, instead infers type and analysis
Let's see following example:
Use case: In both functions, it checks nullptr first, does other work and then accesses the pointer without checking nullptr
Result: cppcheck succeeds in checking warnings in function f5, but FAILs in f4
=> seems like cppcheck cannot infer return type of func() as pointer from 2 expressions: compare vs nullptr and access operator -> later // <=== Can this be improved?
Dear dev teams,
I understand the awesomeness that cppcheck hardly checks syntax, instead infers type and analysis
Let's see following example:
Use case: In both functions, it checks nullptr first, does other work and then accesses the pointer without checking nullptr
Result: cppcheck succeeds in checking warnings in function f5, but FAILs in f4
=> seems like cppcheck cannot infer return type of func() as pointer from 2 expressions: compare vs nullptr and access operator -> later // <=== Can this be improved?
cppcheck version: Cppcheck 2.14.1
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/13020