Menu

library configuration

PMPM
2016-06-03
2016-06-03
  • PMPM

    PMPM - 2016-06-03

    I am learning how to use cppcheck. I am confused about the library configuration. How do I find out what functions and what configuration should be added? If this is not set, does it mean it cannot do memory leak check? Thanks.

     
  • Mr. X

    Mr. X - 2016-06-03

    If this is not set, does it mean it cannot do memory leak check?

    new/delete (C++) does always work and std.cfg is always loaded, so malloc/free should always work, too. However, in libraries also other functions can be specified to tell cppcheck that they have no impact on allocated memory (<leak-ignore/>), which increases the accuracy of results. Custom allocation functions need to be specified in libraries, otherwise cppcheck is not able to detects leaks when using them.

    How do I find out what functions and what configuration should be added?

    --check-library gives you a hint.

     

    Last edit: Mr. X 2016-06-03

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.