Menu

Using cppcheck on a C++ template library

2024-09-16
2024-10-15
  • JWellbelove

    JWellbelove - 2024-09-16

    I have a requirement to do static analysis on my header-only C++ template library.
    It is normally exercised by a set of unit tests, but I require the static analysis results to only show issues with the header template code. Is this possible? Or can cppcheck just analyse the header files only, without requiring code to instantiate the templates?

     
  • Daniel Marjamäki

    Sorry for late reply. It is possible but I would recommend that you use Cppcheck on properly instantiated code also. having some proper values and types etc to reason about should help.

     

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.