Menu

Old Trac server is down

2019-09-16
2019-10-30
<< < 1 2 (Page 2 of 2)
  • Steve Albright

    Steve Albright - 2019-10-15

    Thanks, that worked

     
  • Steve Albright

    Steve Albright - 2019-10-15

    Here is an example I don't like cppcheck flagging with knownConditionTrueFalse

    void SomeFunctionThatTakesABool(bool hasAttribute)
    {
       if(hasAttribute)
       {
       }
    }
    
    void ExampleFunction()
    {
       const bool hasIt = true;
    
       SomeFunctionThatTakesABool(!hasIt);
    }
    

    We really may want to run the negative test at times. In the same function we may call it with the positive case too.

    I often work around this by making a local non const and changing it's value but that is a waste.

     
    • versat

      versat - 2019-10-16

      This is maybe a related ticket: https://trac.cppcheck.net/ticket/9363

       
      • Steve Albright

        Steve Albright - 2019-10-16

        Thanks for pointing that out, I added a comment on it and support not flagging it.

         
<< < 1 2 (Page 2 of 2)

Log in to post a comment.