Menu

False positive for MISRA 2012 15.5 with lambdas

martinbutt
2021-10-25
2021-11-27
  • martinbutt

    martinbutt - 2021-10-25

    This code:

    bool myFunction(Type type)
    {
        return myLambda(type) {
            return type.empty();
        });
    }
    

    Triggers this rule:
    MISRA Rule 15.5 : Multiple points of exit detected. Function should have a single point of exit at the end of the function

     
  • Daniel Marjamäki

    Sorry for late reply. But the misra addon is currently only for Misra C 2012. And C++ code is not supported. We might add a C++ addon in the future.

     

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.