Menu

False positives for unusedFunction in Myrlyn

Christoph
2025-03-09
2025-03-09
  • Christoph

    Christoph - 2025-03-09

    Dear cppcheck team!

    I used Cppcheck on Myrlyn [1]. It reports dozens of unused functions. I
    checked several of them and only found false positives.

    Example:

    /home/gruenich/myrlyn/src/YQZypp.h:84:0: style: The function 'ZyppRepositoriesEnd' is never used. [unusedFunction]
    inline ZyppRepositoryIterator ZyppRepositoriesEnd() { return zyppPool().knownRepositoriesEnd(); }
    ^

    Removing the function leads to a compiler error that the function is
    missing. A simple git grep finds multiple uses of the function.

    What can I provide to help you identify the problem within Cppcheck? I
    use Cppcheck 2.17.0. The command I executed was:

    cppcheck --std=c++17 --check-level=exhaustive --project=compile_commands.json --enable=all --suppress=missingIncludeSystem

    [1] https://github.com/shundhammer/myrlyn

    Bye
    Christoph

    --
    Most customers will not accept source code with compile errors in it.
    Dan Saks, CppCon 2016 (https://youtu.be/D7Sd8A6_fYU)

     
  • CHR

    CHR - 2025-03-09

    Can you provide a reduced, self-contained example that shows the issue?

     

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.