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

MISRA C rules reference

Environment rules

The rules in this section are concerned with the language environment.

Rule 1 (required) All code shall conform to ISO 9899 standard C, with no extensions permitted.

How the rule is checked

The compiler will generate an error, indicating a violation of this rule, if the compiler is configured (using command line options or GUI options) to:

compile with IAR extensions

compile C++ code.

Note: The compiler does not generate this error if you use IAR extensions from within the code by using a pragma directive.

Examples of rule violations

int __far my_far_variable; int port @ 0xbeef;

Example of correct code

#pragma location=0xbeef int port;

Rule 2 (advisory) Code written in languages other than C should only be used if there is a defined interface standard for object code to which the compiler/assemblers for both languages conform.

How the rule is checked

Violations of this rule are not checked for by the compiler or linker. This rule requires manual checking.

Rule 3 (advisory) Assembler language functions that are called from C should be written as C functions containing only inline assembler language, and inline assembler language should not be embedded in normal code.

How the rule is checked

Violations of this rule are not checked for by the compiler or linker.

17

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