Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
2012 / MISRA / EW_MisraCReference.pdf
Скачиваний:
129
Добавлен:
10.02.2015
Размер:
650.9 Кб
Скачать

Command line compiler options

This chapter explains how to set the compiler options from the command line,

and gives detailed reference information about each option.

Options summary

The following table summarizes the compiler command line options:

Command line option Description

--misrac

Enables MISRA C-specific

 

error messages

--misrac_verbose

Enables verbose logging of

 

MISRA C checking

 

 

Table 2: Compiler options summary

 

Descriptions of options

The following section gives detailed reference information about each compiler option.

--misrac --misrac[={tag1,tag2-tag3,…|all|required}]

Use this option to enable the compiler to check for deviations from the rules described in the MISRA Guidelines for the Use of the C Language in Vehicle Based Software. By

using one or more arguments with the option, you can restrict the checking to a specific subset of the MISRA C rules. The possible arguments are described in this table:

Command line option

Description

--misrac

Enables checking for all MISRA C rules

--misrac=n

Enables checking for the MISRA C rule with number n

--misrac=m,n

Enables checking for the MISRA C rules with numbers m

 

and n

--misrac=k-n

Enables checking for all MISRA C rules with numbers from

 

k to n

Table 3: Enabling MISRA C rules (--misrac)

5

Descriptions of options

Command line option

Description

 

 

--misrac=k,m,r-t

Enables checking for MISRA C rules with numbers k, m, and

 

from r to t

--misrac=all

Enables checking for all MISRA C rules

--misrac=required

Enables checking for all MISRA C rules categorized as

 

required

Table 3: Enabling MISRA C rules (--misrac) (Continued)

If the compiler is unable to check for a rule, specifying the option for that rule has no effect. For instance, MISRA C rule 15 is a documentation issue, and the rule is not checked by the compiler. As a consequence, specifying --misrac=15 has no effect.

Note: MISRA C is not supported by all IAR Systems products. If MISRA C checking is not supported by the compiler, using this option will generate an error.

To set the equivalent option in the IAR Embedded Workbench, select

Project>Options>General Options>MISRA C or Project>Options>C/C++

Compiler>MISRA C.

--misrac_verbose --misrac_verbose

Use this option to generate a MISRA C log during compilation and linking. This is a list of the rules that are enabled—but not necessarily checked—and a list of rules that are actually checked.

If this option is enabled, the compiler displays a text at sign-on that shows both enabled and checked MISRA C rules.

To set the equivalent option in the IAR Embedded Workbench, select

Project>Options>General Options>MISRA C.

IAR Embedded Workbench® MISRA C

6 Reference Guide

Соседние файлы в папке MISRA