Menu

how to get support for understanding the source code of cppcheck

wy163
2024-12-28
2025-01-02
  • wy163

    wy163 - 2024-12-28

    HI, by reading the code, sometimes I can not know how to use the functions of the source code of cppcheck. For example,

    bool Token::hasKnownValue() const
    

    I don't know the meaning of that. If I'd like to code with cppcheck, is there any document to comment the interfaces of the main classes, like Token.
    And I also tried to use IRC channel #cppcheck. But seems there is no discussion there. Does it still work?
    Thanks!

     
    • Daniel Marjamäki

      sorry for late reply.

      An expression has a "known" value if its value is known at compile time.

      Example:

      void foo(int x) {
          if (x == 3) {
              a = x + 5;  // <- `x+5` has a known value, it is always 8
          }
          b = x + 5;  // <- `x+5` does not have a known value it is "possible" that it's 8.
      }
      

      so:
      * "known": when expression always have a certain value in all possible execution paths
      * "possible": when expression has a certain value in a possible execution path but not all paths

      you can try with the chat again.. I am there sometimes.

      But feel free to ask more questions here in the forum also.

       

      Last edit: Daniel Marjamäki 2025-01-02

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.