1 year ago

#254362

test-img

Hawkie

Coverity Static Analysis UNINIT Error in C++

I'm new to Coverity and lambdas and am trying to figure our what's causing the UNINIT error of "creating a temporary" and "using uninitialized value <temporary>.__f_.__buff_ when calling ~function"

class DeckProcess{
     
     void foo(){/*do stuff*/}
     
     std::unique_ptr<Monitor>     m_monitor;
     std::shared_ptr<Controller>  m_controller;
        
     void initStatusCheck(){
            //Constructor in different file
            //Monitor(const std::function<void()> & name, param2, param3)
        
            m_monitor = std::unique_ptr<Monitor>(new Monitor([this](){
                                                     if(m_controller){
                                                                       m_controller->foo();
                                                                     }
                                                      }, arg2, arg3));     
     }
}

c++

lambda

static-analysis

coverity

0 Answers

Your Answer

Accepted video resources