Menu

False Positive Broken AST

Saad Munir
2021-02-03
2021-02-19
  • Saad Munir

    Saad Munir - 2021-02-03
    typedef map<string, my_struct_t*> my_struct_map_t;
    typedef my_struct_map_t::iterator my_struct_map_iter_t;
    
    void my_func(my_struct_map_t* my_data) {
        my_struct_map_iter_t iter = my_data->find("my_string");
    
        my_struct_t* tmp = (my_struct_t*)iter->second;<--- Syntax Error: AST broken, binary operator '=' doesn't have two operands.
            .
            .
            .
    }
    

    For the code like above in our program, CPPCheck is reporting broken AST error. This not an actual issues, probably a bug in CPPCheck.

     

    Last edit: Saad Munir 2021-02-03
  • CHR

    CHR - 2021-02-19

    I'm unable to reproduce this with 2.3.

     

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.