MISRA C Compliance Checker

Overview

MISRA C:1998 Compliance Matrix

MISRA C:2004 Compliance Matrix

MISRA C:2012 Compliance Matrix

MISRA C Checker Template File

MISRA C Compliance Matrix Template File

MISRA C Checker Message Log

Overview

C program language has a range of advantages for use in embedded software: compiler availability for various microprocessors, an efficient code, support for low-level communication with hardware, portability, and so on.

On the other hand, certain factors have a negative effect on the accuracy and quality of the code: the possibility for typographical errors which result in compiler warnings; syntax which enables the writing of clear code but also an illegible coding style; hard to grasp language constructs, for example, complex operator priority rules; incomplete definition in semantics standard of certain parts of the language.

The document Guidelines for the Use of the C Language in Vehicle Based Software, published by the Motor Industry Software Reliability Association (MISRA), specifies a C language subset well suited to embedded systems to security level 3 locked. Within static code analysis, DA-C implements checking compliance with the greatest part of standard rules which protect the code in accordance with the MISRA C rulebook. For more information about MISRA C Compliance in DA-C see chapter "MISRA C:1998 Compliance Matrix", "MISRA C:2004 Compliance Matrix" or "MISRA C:2012 Compliance Matrix"

Using the Start > Build Project and Start > Rebuild Project commands, you can initiate various modalities of static code analysis. Within the analysis, MISRA C rules are checked and the breaking of any rule is reported in the Messages window. Reports go to the Static Code Analysis tab - together with static code analysis messages, or to a separate MISRA C tab, which can be assigned by configuration. The form of the report is:

filename line_number MISRA C rule_number: description

where filename and line_number specify the location in the source code where the rule was broken, rule_number specifies the ordinal number of the rule, and description the rule description.

MISRA C Checker Template File

MISRA C warnings configuration can be saved in template file and later restored allowing you to switch between configurations. If template file is not set, Project file is used to save configuration.

MISRA C Compliance Matrix Template File

You may generate actual MISRA C Compliance Matrix, please see "Options > Static Code Analyzer"

MISRA C Checker Message Log

Check results are displayed in the Message Logs, in the form of a warnings.

Double-clicking the line in the Message Logs with warning takes you to the location of the definition of the symbol in question in the project source code.

MISRA C Checker Messages Log

If you enable the Report separately option, these warnings will be displayed in a separate Message Logs tab. If you have disabled this option, warnings are displayed together with Static Code Analysis warnings. Additionally, you may, with a right-click on the message, access our Forum to see the discussion or post one question.

"MISRA" and "MISRA C" are registered trademarks owned by HORIBA MIRA Ltd, held on behalf of the MISRA Consortium.