Skip to main content

IAR Embedded Workbench for RH850 3.20.x

The scope of the C-STAT checks

In this section:

The checks in C-STAT can be divided into checks performed on the source code and checks performed at link time.

Source code checks search for deviations from a coding rule in the C or C++ source code in the user project and any included user headers (included with #include "xxx"). System headers (included with #include <xxx>) and assembler source code are not searched.

Link time checks search for deviations from coding rules that specify how global and static objects (variables and functions) can be used. The search might be incomplete because the checks search the C or C++ source code for global and static objects and then C-STAT analyzes the code to see whether any deviations have occurred. If the user project contains assembler source code or third-party libraries, the search might yield false positives.

Also note that some MISRA C 2012 checks—MISRAC2012-Rule-5.2, MISRAC2012-Rule-5.3, MISRAC2012-Rule-5.4, MISRAC2012-Rule-5.5, and MISRAC2012-Rule-20.4—all have one variant for C89 and one for C99. The C89 variants are only used if the source code was compiled in C89 mode, otherwise the C99 variants are used.

Note

When you use C-STAT, the compiler options for each C/C++ source file must be the same as in the user project, otherwise the analysis might give incorrect results.