1) Missing - there is an active #include for the configuration, but the header can not be found (what header file name, what file path is it involved in)
2) Unnecessary - None of the content in the header file (nor what it includes) has a material impact on the compilation
3) Unused - None of the solutions in a system include the header, though it exists on one of the include paths
4) Extraneous include paths - No actual relevant .h files were loaded from this path.
There are a few advanced variants, but this should give an idea...
I am asking because I have been charged with modernizing a 25 year old (continual development, but no preventative maintenance) that has over 5000 separate .vcxproj (Visual Studio) across over 1000 solutions, with 17.5K++ .cpp files and 25K++ .h files... Manual examination is NOT going to be feasible...
I fear that is beyond the scope of cppcheck. I made a tool ~10 years ago https://github.com/danmar/checkheaders feel free to try it out. I made it a separate tool because it required a different preprocessing and/or lexing. It was not possible 10 years ago to use Cppcheck infrastructure directly. I do not remember the details maybe it would work better today.
But I'd guess more modern tools might be better. I have not tested it but the "include what you use" iwyu might do what you want.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You might want to take a look at https://include-what-you-use.org/ - beware distros have quite outdated versions of it and it has false positives. It requires a compilation database though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Was hoping CppCheck could help...
1) Missing - there is an active #include for the configuration, but the header can not be found (what header file name, what file path is it involved in)
2) Unnecessary - None of the content in the header file (nor what it includes) has a material impact on the compilation
3) Unused - None of the solutions in a system include the header, though it exists on one of the include paths
4) Extraneous include paths - No actual relevant .h files were loaded from this path.
There are a few advanced variants, but this should give an idea...
I am asking because I have been charged with modernizing a 25 year old (continual development, but no preventative maintenance) that has over 5000 separate .vcxproj (Visual Studio) across over 1000 solutions, with 17.5K++ .cpp files and 25K++ .h files... Manual examination is NOT going to be feasible...
I fear that is beyond the scope of cppcheck. I made a tool ~10 years ago https://github.com/danmar/checkheaders feel free to try it out. I made it a separate tool because it required a different preprocessing and/or lexing. It was not possible 10 years ago to use Cppcheck infrastructure directly. I do not remember the details maybe it would work better today.
But I'd guess more modern tools might be better. I have not tested it but the "include what you use" iwyu might do what you want.
You might want to take a look at https://include-what-you-use.org/ - beware distros have quite outdated versions of it and it has false positives. It requires a compilation database though.