Christian Fehse - 2021-02-20

Hi,

if you create a simple GUI project file like this:

<?xml version="1.0" encoding="UTF-8"?>
<project version="1">
    <platform>win32A</platform>
    <analyze-all-vs-configs>false</analyze-all-vs-configs>
    <check-headers>true</check-headers>
    <check-unused-templates>true</check-unused-templates>
    <max-ctu-depth>2</max-ctu-depth>
    <max-template-recursion>100</max-template-recursion>
    <paths>
        <dir name="."/>
    </paths>
    <exclude>
        <path name="test/"/>
    </exclude>
</project>

and exclude a directory (in this example test/) this directory is correctly excluded from the checks.

If however the project file itself lives under a path that by itself includes a path element test the software reports that no files where found for processing. This behavior applies to the command line version (started with --project) and the Cppcheck GUI. If one moves the project file and source tree to a directory which does not contain any of the excluded directory names the checks start working again.

This was tested with Cppcheck 2.3 under Windows 10 (unfortunately I had no linux system available with a version of Cppcheck > 1.9 to crosscheck there).

I attached a zip containing a directory structure to illustrate the problem. The zip contains the project file and sources in a directory named test and therefore no files to check will be found. If one renames the directory the checks will work.

Thanks in advance!

 

Last edit: Christian Fehse 2021-02-20