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

Conversions

Rule 39 (required) The unary minus operator shall not be applied to an unsigned expression.

How the rule is checked

The compiler will generate an error, indicating a violation of this rule, if unary minus is applied to an expression with an unsigned type.

Rule 40 (advisory) The sizeof operator should not be used on expressions that contain side effects.

How the rule is checked

The compiler will generate an error, indicating a violation of this rule, if the sizeof operator is applied to an expression containing either ++, --, an assignment operator, or a function call.

Rule 41 (advisory) The implementation of integer division in the chosen compiler should be determined, documented, and taken into account.

How the rule is checked

This is implementation-defined behavior. For the IAR C/C++ Compiler, the sign of the

remainder on integer division is the same as the sign of the dividend, as documented in the IAR C/EC++ Compiler Reference Guide.

Rule 42 (required) The comma operator shall not be used, except in the control expression of a for loop.

How the rule is checked

The compiler will generate an error, indicating a violation of this rule, if a comma is used anywhere except in the first or last part in the head of a for loop.

Conversions

The rules in this section are concerned with data conversion and type casts.

Rule 43 (required) Implicit conversions which may result in a loss of information shall not be used.

How the rule is checked

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

IAR Embedded Workbench® MISRA C

30 Reference Guide

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