AUTOSAR C++14 Rule A2-13-3
Type wchar_t shall not be used
Description
Rule Definition
Type wchar_t shall not be used.
Rationale
The size of wchar_t
is implementation-dependent. If you use
wchar_t
for Unicode values, your code is bound to a specific
compiler.
To improve the portability of your code, use char16_t
and
char32_t
instead. These are standard types introduced in C++11 for text
strings with UTF-16 and UTF-32 encodings.
Polyspace Implementation
The rule checker flags all uses of the wchar_t
keyword.
If you do not want to fix the issue, add a comment justifying the result. See:
Address Results in Polyspace User Interface Through Bug Fixes or Justifications if you review results in the Polyspace user interface.
Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access) if you review results in a web browser.
Annotate Code and Hide Known or Acceptable Results if you review results in an IDE.
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, Automated |
Version History
Introduced in R2019a