Main Content
MISRA C++:2008 Rule 2-13-5
Narrow and wide string literals shall not be concatenated
Description
Rule Definition
Narrow and wide string literals shall not be concatenated.
Rationale
Narrow string literals are enclosed in double quotes without a prefix. Wide string
literals are enclosed in double quotes with a prefix L
outside
the quotes. See string
literals.
Concatenation of narrow and wide string literals can lead to undefined behavior.
Polyspace Implementation
The rule checker reports violations on concatenations of wide string literals with narrow string literals.
Troubleshooting
If you expect a rule violation but Polyspace® does not report it, see Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Lexical Conventions |
Category: Required |
Version History
Introduced in R2013b