JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
C and C++


PARSE.UNICP : Universal Character Name Names Invalid Code Point

Summary

A universal character specified with \U does not represent a valid Unicode code point.

This warning class is derived from a C/C++ parser warning.

Properties

Class Name Universal Character Name Names Invalid Code Point
Significance style
Mnemonic PARSE.UNICP
Categories
Misra2004 Misra2004:4.1 Only those escape sequences that are defined in the ISO C standard shall be used
AUTOSARC++14 AUTOSARC++14:A2-13-1 Only those escape sequences that are defined in ISO/IEC 14882:2014 shall be used.
MisraC++2008 MisraC++2008:2-13-1 Only those escape sequences that are defined in ISO/IEC 14882:2003 shall be used.
MisraC++2023 MisraC++2023:5.13.1 Within character literals and non raw-string literals, \ shall only be used to form a defined escape sequence or universal character name
Availability Available for C and C++.
Enabling Checks for this warning class are enabled by default. However, warning instances of this class that are issued as parser errors (rather than parser warnings) will be discarded when using factory configuration settings. To prevent these instances from being discarded, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += allow class="Universal Character Name Names Invalid Code Point"
To disable checks for this warning class, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += discard class="Universal Character Name Names Invalid Code Point"

Example

#include <stddef.h>

wchar_t invalid_codepoint_wch = L'\U00A00000';     /* 'Universal Character Name Names Invalid Code Point' warning issued here
                                                    * - \U00A00000 does not correspond to a valid code point
                                                    */
wchar_t valid_codepoint_wch = L'\U000000F6';                                /* ok: \U000000F6 is a valid code point */

char *invalid_codepoint_str = "hello \U00999999";  /* 'Universal Character Name Names Invalid Code Point' warning issued here
                                                    * - \U00999999 does not correspond to a valid code point
                                                    */
char *valid_codepoint_str = "hello \U000000E9";                             /* ok: \U000000E9 is a valid code point */

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.

 

To report problems with this documentation, please visit https://support.codesecure.com/.