MISRA-C:2012 compliance

From SEGGER Wiki
Revision as of 10:01, 28 April 2020 by Til (talk | contribs) (Created page with "MISRA C is a set of software development guidelines for the C programming language developed by MISRA (Motor Industry Software Reliability Association). embOS is MISRA-C:2012...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

MISRA C is a set of software development guidelines for the C programming language developed by MISRA (Motor Industry Software Reliability Association). embOS is MISRA-C:2012 compliant.

What needs to be done in order to be MISRA-C:2012 compliant?

The official MISRA-C:2012 document "Guidelines for the use of the C language in critical systems" explains what needs to be done. MISRA-C:2012 defines a set of guidelines which needs to be followed by the C program author. These guidelines are split into Directives and Rules. All guidelines can be mandatory, required or advisory. Mandatory guidelines must not be violated. Required and advisory guidelines can be violated but every violation of a required guideline must be documented and justified in a MISRA document. Most of the guidelines can be tested with a static analysis tool but not all. Some guidelines can be checked with the C compiler or code review only. Therefore a C source code is not MISRA-C:2012 compliant when a static analysis tool does not complain about any issue. In any case a dedicated MISRA document is mandatory. The official MISRA-C:2012 document explains the structure of such a MISRA document.

What part of an actual embOS port is MISRA compliant?

Basically embOS consists of three parts: the generic sources which are the same for all embOS ports, the core/compiler specific files and the board support package files. The embOS MISRA compliance covers the embOS generic sources only. If MISRA compliance for the core/compiler specific sources is required that can be done on request. The BSP files are usually not checked.

What static analysis tool is used?

We use PC-lint V9 from Gimpel Software. The embOS source code contains Lint suppression comments for some MISRA guidelines. That helps to know which MISRA-C:2012 guideline is violated and must be documented and justified. We treat advisory guideline like required guidelines which means we document and justify required and advisory guidelines.

I use another static analysis tool and it reports violations. How can I deal with that?

If your static analysis tool reports MISRA-C:2012 violations it does not mean embOS is not MISRA-C:2012 compliant. It just means embOS does not contain suppression comments for your actual static analysis tool. It makes no sense to include according comments in the embOS source code for every existing MISRA checker. The easiest way to deal with it is to disable the MISRA checker for the embOS files. It is not necessary to check the embOS files again since that was already done by SEGGER.

How can I get the embOS MISRA-C:2012 document?

If embOS is part of your application and you need to proof your application is MISRA-C:2012 compliant you can buy the embOS MISRA-C:2012 document from SEGGER.