Menu

any warning for header file not used?

2023-02-27
2023-04-05
  • Edward Welch

    Edward Welch - 2023-02-27

    Is there any warning for a header file that's not used?
    For instance, if I use classX for instance, I include the header file (#include "classX.h" ). Some stage down the line I remove the code using classX, but forget to remove the header file.

     
  • Robert Lipe

    Robert Lipe - 2023-04-05

    I don't think cppcheck can do this. You may find joy in "include-what-you-use".

    https://include-what-you-use.org/
    It's not awesome to use if you're not already using Clang as it REQUIRES Clang's development libraries. It is, however, awesome once you get it installed.

     

Log in to post a comment.