Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wiki Markup
According to \[[MISRA 08|AA. C References#MISRA 08]\], concatenation of wide and narrow string literals leads to undefined behavior. This is an inplicit undefined behavior according to C99 \[[ISO/IEC 9899:1999|AA. C References#ISO/IEC 9899-1999]\].

Noncompliant Code Example

...

Compliant Solution (wide string literals)

This compliant solution concatenates wide string literals onlyIf the concatenated string needs to be a wide string literal, each element in the concatenation has to be a wide string literal.

Code Block
bgColor#ccccff
wchar_t *msg = L"This message is very long, so I want to divide it "
               L"into two parts.";

...

Wiki Markup
\[[MISRA 08|AA. C References#MISRA 08]\] Rule 2-13-5
\[[ISO/IEC 14882-2003|AA. C References#ISO/IEC 14882-2003]\] 2.13.4 String literals