On a current develop version of cppcheck I get a false positive CastAddressToIntegerAtReturn with following code:
#include <memory> #include <future> struct Foo { std::future<int> unfinishedBlobsCount() const { return std::future<int>{}; } }; int unfinishedBlobsCount() { std::shared_ptr<Foo> foo = std::make_shared<Foo>(); auto get_future = foo->unfinishedBlobsCount(); return get_future.get(); }
../cppcheck/build/bin/cppcheck test.cpp --enable=style --inconclusive Checking test.cpp ... test.cpp:15:3: portability: Returning an address value in a function with integer return type is not portable. [CastAddressToIntegerAtReturn] return get_future.get(); ^ [...]
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/12159
Log in to post a comment.
On a current develop version of cppcheck I get a false positive CastAddressToIntegerAtReturn with following code:
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/12159