Menu

How to ignore a specific file

2018-07-20
2018-08-01
  • William Lofgren

    William Lofgren - 2018-07-20

    I have combed through the documentation and these forums and cannot find the answer to my question. I have a .ccpcheck XML file that I use to set parameters when I start CPPCheck. The one thing I cannot figure out is the XML parameters to ignore one specific file. This check is doing a whole file system. I have excluded several directories and suppressed two messages that are not relevant to my work. But I cannot figure out how to ignore a certain file.
    Please help me.

    Here is the XML code we use.

    <?xml version="1.0" encoding="UTF-8"?>
    <project version="1">
        <root name="D:/Projects/Libraries"/>
        <builddir>LibrariesCheck-cppcheck-build-dir</builddir>
        <platform>Unspecified</platform>
        <analyze-all-vs-configs>true</analyze-all-vs-configs>
        <exclude>
            <path name="Debug/"/>
            <path name="D:/Projects/Libraries/.svn/"/>
            <path name="IO_LegacyMicrosoft/"/>
            <path name="MatlabMathLibraryR12/"/>
            <path name="Release/"/>
        </exclude>
        <suppressions>
            <suppression>unusedFunction</suppression>
            <suppression>unusedPrivateFunction</suppression>
        </suppressions>
    </project>
    
     
  • versat

    versat - 2018-07-31

    This ticket could be related: https://trac.cppcheck.net/ticket/8637
    Can you verify if it works when using the full path or by prepending a * like described in the ticket?

    Sorry, the ticket is about suppressions, not excludes. But maybe it is worth giving it a try to use full path names, relative path or so. What have you used?
    A workaround might be to suppress whole files if exclude does not work at the moment.

     

    Last edit: versat 2018-07-31
  • versat

    versat - 2018-07-31

    Maybe also interesting: https://trac.cppcheck.net/ticket/8347
    Files that are analyzed because they are included can not be excluded (but suppression should work)

     
  • Daniel Bengtsson

    I just posted a related topic https://sourceforge.net/p/cppcheck/discussion/general/thread/94ffb177/

    But in there I got the exclusion to work in some environments but not others - so I am rather confused as to what behavior is expected or if it's configurable or something else?

     

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.