Menu

Check header => Check source files that include it

2016-10-24
2017-01-23
  • Daniel Marjamäki

    Wild idea..

    We have always recommended that headers are not checked directly.. instead the sourcefiles that include the headers should be checked. Checking headers directly has always resulted in false positives and wrong configurations etc.

    If the user wants to check a header file, it is recommended that some source files that #include the header are checked instead. Cppcheck could do this automatically - whenever a header file is given, look up source files that include it directly or indirectly and check those.

    I am a bit worried that we will break some script if we do this. Should it be possible to select behaviour with some command line flag?

     
  • Mr. X

    Mr. X - 2016-10-25

    I do not think that this is a good idea. If a user wants to check a header, cppcheck should check the header. Anything else would be confusing. And it would not work well anyway if some header-only library should be checked.

     
  • Maksim Derbasov

    Maksim Derbasov - 2017-01-23

    It could be handy for some header-base libraries; IMHO, some kind of flag could be usefull

     

Log in to post a comment.