cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

enabled `valueFlowBailoutIncompleteVar` in selfcheck

Open firewave opened this issue 2 years ago • 13 comments

firewave avatar Aug 19 '23 21:08 firewave

https://trac.cppcheck.net/ticket/10045 is the meta ticket which already contains some (outdated) data and references.

firewave avatar Aug 19 '23 21:08 firewave

I am a bit curious that there is just a single complaint about a very common symbol as std::string::npos.

firewave avatar Aug 21 '23 16:08 firewave

Seems like the remaining bailouts are cfg-related, except for that uninstantiated(?) template parameter.

chrchr-github avatar Sep 19 '23 12:09 chrchr-github

gui/codeeditorstyle.cpp:125:40: debug: valueflow.cpp:10106:valueFlowConditionExpressions bailout: Skipping function due to incomplete variable widgetFGColor [valueFlowBailoutIncompleteVar]
            QVariant(defaultStyleLight.widgetFGColor)).value<QColor>();
                                       ^

firewave avatar Sep 19 '23 12:09 firewave

gui/codeeditorstyle.cpp:125:40: debug: valueflow.cpp:10106:valueFlowConditionExpressions bailout: Skipping function due to incomplete variable widgetFGColor [valueFlowBailoutIncompleteVar]
            QVariant(defaultStyleLight.widgetFGColor)).value<QColor>();
                                       ^

https://trac.cppcheck.net/ticket/10045#comment:30

chrchr-github avatar Sep 19 '23 14:09 chrchr-github

lib/valueflow.cpp:2516:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable None [valueFlowBailoutIncompleteVar]
            return Action::None;
                           ^

https://trac.cppcheck.net/ticket/12538.

firewave avatar Mar 22 '24 08:03 firewave

lib/astutils.cpp:343:90: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable intvalue [valueFlowBailoutIncompleteVar]
    if (!tok->varId() && tok->hasKnownIntValue() && std::to_string(tok->values().front().intvalue) == rhs)
                                                                                         ^

https://trac.cppcheck.net/ticket/12539.

firewave avatar Mar 22 '24 09:03 firewave

externals/simplecpp/simplecpp.cpp:1348:32: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SYNTAX_ERROR [valueFlowBailoutIncompleteVar]
            err.type = Output::SYNTAX_ERROR;
                               ^

https://trac.cppcheck.net/ticket/12567

firewave avatar Apr 03 '24 08:04 firewave

I am a bit curious that there is just a single complaint about a very common symbol as std::string::npos.

This was an actual bug and has been addressed in #6153.

firewave avatar Apr 03 '24 11:04 firewave

I added a few more tickets: https://trac.cppcheck.net/ticket/10949 - npos https://trac.cppcheck.net/ticket/12577 - endl https://trac.cppcheck.net/ticket/12578 - cout/cerr https://trac.cppcheck.net/ticket/12580 - errno https://trac.cppcheck.net/ticket/12581 - __func__

firewave avatar Apr 03 '24 12:04 firewave

Seems like the remaining bailouts are cfg-related, except for that uninstantiated(?) template parameter.

The most common ones actually require special handling and cannot simply be solved via the configuration. I filed tickets for most of them as they are also the top results in daca.

firewave avatar Apr 03 '24 13:04 firewave

lib/checkautovariables.cpp:268:78: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable inconclusive [valueFlowBailoutIncompleteVar]
    const bool printInconclusive = mSettings->certainty.isEnabled(Certainty::inconclusive);
                                                                             ^

https://trac.cppcheck.net/ticket/12585

firewave avatar Apr 03 '24 22:04 firewave