How can I avoid false positive reports when using DPDK's "likely" and "unlikely" branch prediction macros?
eg, "Memory leak" is reported for this snippet:
ptr = calloc(...); if (unlikely(!ptr)) { RTE_LOG(...); return NULL; }
Thanks.
you could test the configuration in gnu.cfg
<define name="likely(X)" value="(X)"/> <define name="unlikely(X)" value="(X)"/>
Thanks @danielmarjamaki, cppcheck --library=gnu ... solved that.
cppcheck --library=gnu ...
Log in to post a comment.
How can I avoid false positive reports when using DPDK's "likely" and "unlikely" branch prediction macros?
eg, "Memory leak" is reported for this snippet:
Thanks.
you could test the configuration in gnu.cfg
Thanks @danielmarjamaki,
cppcheck --library=gnu ...
solved that.