Download Using the ARM Embedded Tools

Transcript
Using the Compiler
Note that not all MISRA−C violations will be reported when other errors are detected in the input
source. For instance, when there is a syntax error, all semantic checks will be skipped, including
some of the MISRA−C checks. Also note that some checks cannot be performed when the
optimizations are switched off.
Quality Assurance report
To ensure compliance to the MISRA−C rules throughout the entire project, the TASKING linker can
generate a MISRA−C Quality Assurance report. This report lists the various modules in the project with
the respective MISRA−C settings at the time of compilation. You can use this in your company’s quality
assurance system to provide proof that company rules for best practice programming have been
applied in the particular project.
To apply MISRA−C code checking to your application
1. From the Project menu, select Project Options...
The Project Options dialog box appears.
2. Expand the C Compiler entry and select MISRA−C.
3. Select a MISRA−C configuration. Select a predefined configuration for conformance with the
required rules in the MISRA−C guidelines.
It is also possible to have a project team work with a MISRA−C configuration common to the whole
project. In this case the MISRA−C configuration can be read from an external settings file.
4. (Optional) In the MISRA−C Rules entry, specify the individual rules.
On the command line you can use the −−misrac option.
carm −−misrac={all | number [−number],...]
See compiler option −−misrac in section 5.1, Compiler Options in Chapter Tool Options of the
reference manual.
See linker option −−misra−c−report in section 5.3, Linker Options in Chapter Tool Options of
the reference manual.
5.8
C Compiler Error Messages
The C compiler reports the following types of error messages.
F ( Fatal errors)
After a fatal error the compiler immediately aborts compilation.
E (Errors)
Errors are reported, but the compiler continues compilation. No output files are produced unless you
have set the compiler option −−keep−output−files (the resulting output file may be incomplete).
5−13