Menu

confusing message about skipping standard includes

2025-05-15
2025-05-31
  • Richard Lewis

    Richard Lewis - 2025-05-15
    $ cat foo.c
    #include <stdio.h>
    void main(void){}
    
    $ cppcheck --enable=all foo.c
    nofile:0:0: information: Cppcheck cannot find all the include files (use --check-config for details) [missingIncludeSystem]
    

    this is a really confusing 'error' message - it says it "cannot find" the include file, and suggests that it is "missing" but this seems to be wrong - i gather that it really means that it did not check the file listed in #include. Could you make the error clearer by changing the text to say

    nofile:0:0: information: Cppcheck does not check included files by
    default (use --check-config for details) [skippedIncludeSystem]
    

    (or even just changing the text before [missingIncludeSystem] would make life easier for the user)

    Similarly,

    $ cppcheck --enable=all foo.c  --check-config
    /tmp/foo.c:1:0: information: Include file: <stdio.h> not found. Please note: Cppcheck does not need standard library headers to get proper results. [missingIncludeSystem]
    

    is also quite confusing - it's clearly not the case that stdio was "not found"

    Couldyou make this one say

    /tmp/foo.c:1:0: information: Include file: <stdio.h> not checked.
    Please note: Cppcheck does not need to check standard library headers to get proper results. [skippedIncludeSystem]</stdio.h>

     
  • Oliver Stöneberg

    Yes, the wording and handling needs to be reworked a bit. It is just misleading and noisy right now. I have not looked into it so far.

     

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.