Menu

[cppcheckError] Analysis failed on valid code using macros that cppCheck isn’t understanding

2022-02-24
2022-03-08
  • Siva Ramaraju

    Siva Ramaraju - 2022-02-24

    The code is valid. It’s using macros that cppcheck isn’t understanding and reports below error
    (error) : [cppcheckError] Analysis failed. If the code is valid then please report this failure. [cppCheck]

    PAS.cpp
    // Wrapper around operation_unref for boolean returning functions.
    define x_unref_bool(opstate) \
    if (P_INIT_UNSUCCESSFUL == & { \
    operation_unref(opstate); \
    return PULSE_INIT_SUCCESSFUL; \
    }()) \
    { \
    return false; \
    }

    --
    bool PAS::SetState(bool bState)
    {
    if …)
    {
    --
    --
    pa_operation op = DELAYLOAD(…);
    x_unref_bool (op)*; ----------> cppCheck reports error for this macro.
    }
    else if (..)
    {
    ..
    }
    else
    {
    --
    }

     
  • Siva Ramaraju

    Siva Ramaraju - 2022-03-08

    Hi Daniel, CHR,
    Greetings!
    Could you help with this issue. Is there a fix for this? any ETA when this would be resolved in upcoming releases.

     
  • CHR

    CHR - 2022-03-08

    Maybe you could post a complete standalone example that reproduces the problem first? ...and --is not helpful. Also better use code tags (Ctrl-Alt-C).

     

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.