Skip to main content

IAR Embedded Workbench for RX 5.20

MISRAC2012-Rule-10.1_R4

In this section:
Synopsis

(Required) Operands shall not be of an inappropriate essential type.

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

An operand was found that is of essentially character type, despite being interpreted as a numeric value.

Coding standards
MISRA C:2012 Rule-10.1

(Required) Operands shall not be of an inappropriate essential type

Code examples

The following code example fails the check and will give a warning:

void example(void) {
  char a = 'a';
  char b = 'b';
  char c;
  c = a * b;
}

The following code example passes the check and will not give a warning about this issue:

void example(void) {
  char a = 'a';
  char b = 'b';
  char c;
  c = a + b;
}