3.3 Perform MISRA Check
Executing static code analysis can help you identify potential issues or risky constructs in the source code.
MISRA Check Execution
Execute static code analysis as specified below.
- MISRA Check Main Project: Click on the toolbar icon or select from the Source menu.
- MISRA Check Project: In the Projects window, right click on a project name and select.
- MISRA Check File: In the Projects window, right click on a project file and select.
- Run MISRA Check each time project is rebuilt: Enable as part of build by checking Tools>Options>Embedded>MISRA Check>Run each time project is rebuilt.
Static Code Analysis Output
The results of static code analysis can be output in one of the following ways.
- Output window: Under the “MISRA Check” tab.
- HTML report file: Enable in Tools>Options>Embedded>MISRA Check.
- CSV report file: Enable in Tools>Options>Embedded>MISRA Check.
Rule violations are identified with “MISRA rule violated” (rule number and description) and location in file where violation was located.
MISRA Check Rule Settings
MISRA rules settings are located in Tools>Options>Embedded>MISRA Check.
MISRA Check Execution from the Command Line
misracli.bat
, for Windows, or misracli.sh
for
Linux/Mac is the command line application for MISRA rule checking. See 3.5 Command Line Support for MISRA Check.