Menu

False knownConditionTrueFalse report when using typeid

Mads Brix
2024-01-11
2024-01-11
  • Mads Brix

    Mads Brix - 2024-01-11

    Running cppcheck 2.13.0 on attached file there is report about knownConditionTrueFalse.
    I think the report is wrong.
    cppcheck --enable=warning,style,performance,portability,missingInclude --suppress=missingIncludeSystem cppcheck-typeid.cc
    Checking cppcheck-typeid.cc ...
    cppcheck-typeid.cc:14:18: style: Condition 'type==typeid(int)' is always false [knownConditionTrueFalse]
    else if (type == typeid(int))
    ^

     
  • CHR

    CHR - 2024-01-11

    Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/12340

     

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.