Menu

knownConditionTrueFalse false-positive using parens instead of equal on a static

2021-09-13
2021-09-14
  • Steve Albright

    Steve Albright - 2021-09-13
    void knownConditionTrueFalseExample()
    {
       static bool initialCall(true); // works with equal sign but not parens
    
       if(initialCall)
       {
          initialCall = false;
       }
    }
    
     
  • CHR

    CHR - 2021-09-14

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

     

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.