Rule 6-6-5 A function shall have a single point of exit at the end of function.

Moderators: david ward, misra cpp

Renan Lavarec
Posts: 1
Joined: Fri Sep 15, 2017 10:13 am
Company: iXblue

Rule 6-6-5 A function shall have a single point of exit at the end of function.

Postby Renan Lavarec » Thu Apr 19, 2018 5:24 pm


mishak
Posts: 10
Joined: Thu Jun 21, 2007 3:58 pm

Re: Rule 6-6-5 A function shall have a single point of exit at the end of function.

Postby mishak » Thu Apr 19, 2018 5:50 pm


misra cpp
Posts: 145
Joined: Mon Jun 02, 2008 1:55 pm
Company: MISRA

Re: Rule 6-6-5 A function shall have a single point of exit at the end of function.

Postby misra cpp » Tue Jul 17, 2018 1:56 pm

We agree with mishak, the single point of exit from a function is a requirement of ISO/IEC 61508. Indeed, it is the only specific design requirement it places on code, and as you point out, arguably it can make code worse.

Your comment about 6-6-5 is incorrect - this is legal code. It’s called a function-try-block, and doesn't require brackets around the try..catch statements
Posted by and on behalf of
the MISRA C++ Working Group


Return to “6.6 Statements (C++)”

Who is online

Users browsing this forum: No registered users and 2 guests