Menu

Included header with mixed case filenames causes problems

Teraslilja
2025-11-24
2026-02-25
  • Teraslilja

    Teraslilja - 2025-11-24

    Operating environment:
    cppcheck compiled at WSL (Ubuntu 22.04.5 LTS), while repository is located at Windows 11 partition.

    If a header is included as #include "Header.hpp" and #include "header.hpp" (mixed cases of letters), it is happily compiled with Visual Studio.

    However, if cppcheck is run (at WSL/Ubuntu), a "syntaxError" is generated (for each different header name), when enumerated class type is defined. Most likely cppcheck thinks that "Header.hpp" and "header.hpp" are different files.

    Maybe the rule's logic need a check for a case, when it is possible that single file is included by varying names..

     
  • Oliver Stöneberg

    Yes, that is a known shortcoming. When you use a binary compiled on a Linux system (even WSL) we assume that all files are case sensitive. But that is not dependent on the system but the underlying filesystem. These issues are already tracked in the underlying simplecpp library via https://github.com/danmar/simplecpp/issues/308 and https://github.com/danmar/simplecpp/issues/309.

     

    Last edit: Oliver Stöneberg 2026-02-25

Log in to post a comment.

MongoDB Logo MongoDB