Skip to main content

IAR Embedded Workbench for RH850 3.20.x

MISRAC++2023-7.0.3 (C++ only)

In this section:
Synopsis

(Required) The numerical value of a character shall not be used

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

Numerical value of char types shall not be used

Coding standards

This check does not correspond to any coding standard rules.

Code examples

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

void example() {
  char c = 65; //  Non-compliant
}

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

void example() {
  char c = 'a'; //  Non-compliant
}