Menu

Regression in cppCheck v2.6/ 2.7 [missingReturn] error from CTOR (false-positive)

2022-02-25
2022-02-26
  • Siva Ramaraju

    Siva Ramaraju - 2022-02-25

    The cppCheck version 2.6 and 2.7 has regression that it reports a false positive [missingReturn] (error) : [missingReturn] Found a exit path from function with non-void return type that has missing return statement from a CTOR.

    TABuffer.cpp(79) : (error) : [missingReturn] Found a exit path from function with non-void return type that has missing return statement [cppCheck]

    TABuffer::TABuffer()
    , m_count(0)
    , m_f(false)
    {
    memset(m_a, 0, sizeof(m_a));
    memset(m_b, 0, sizeof(m_b));
    memset(m_c, 0, sizeof(m_c)); ------> Reports this false-positive (error) : [missingReturn] Found a exit path from function with non-void return type that has missing return statement [cppCheck]
    }

     
  • CHR

    CHR - 2022-02-26

    I can't reproduce this with head. Could you post a more complete example?

     

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.