rtems/src/scheduler* code convention issue

Sebastian Huber sebastian.huber at embedded-brains.de
Tue May 13 06:16:39 UTC 2014


On 2014-05-13 01:28, Joel Sherrill wrote:
> Hi
>
> Both schedulerident.c and schedulergetprocessorset.c do not follow
> RTEMS Coding Conventions on avoidance of deep nesting by using
> early returns.

I don't find such a rule here:

http://www.rtems.org/wiki/index.php/Coding_Conventions

> The nesting on schedulergetprocessorset.c is pretty
> ugly and could have been avoided easily.
>

I prefer a single exit point.  This is also advised by MISRA Rule 15.5.  It is 
required by ISO 61508 and ISO 26262.  It is also "will" rule (AV Rule 113) of 
the "JOINT STRIKE FIGHTER AIR VEHICLE C++ CODING STANDARDS FOR THE SYSTEM 
DEVELOPMENT AND DEMONSTRATION PROGRAM".

http://www.stroustrup.com/JSF-AV-rules.pdf

So if you ask me, then we should also add this to the our coding conventions.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list