Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC++2023-5.13.7

In this section:
Synopsis

(Required) String literals with different encoding prefixes shall not be concatenated

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

Found concatenation with different encoding prefixes This check is identical to MISRAC++2008-2-13-5.

Coding standards
MISRA C++ 2008 2-13-5

(Required) Narrow and wide string literals shall not be concatenated.

Code examples

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

void example() {
  const char* s = u8"Hello" "World";
}

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

void example() {
  const char * s = u8"Hello" u8"World";
}