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.UNRECOGNIZED.CE : Unrecognized Character Escape

要旨

A backslash (\) in a string or character literal is not part of a defined escape sequence or universal character name.

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

プロパティ

クラス名 Unrecognized Character Escape
日本語クラス名 Unrecognized Character Escape
クラス分類 スタイル (style)
ニーモニック PARSE.UNRECOGNIZED.CE
カテゴリー
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
対応言語 C および C++ で利用可能です。
有効/無効設定 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="Unrecognized Character Escape"
To disable checks for this warning class, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += discard class="Unrecognized Character Escape"

char ch_good = '\n';                                      /* \n is a valid character */
char *str_good = "\u00C1\\\U000000E9 hello \044 \x006A\n"; /* all occurrences of \ are in defined escape sequences
                                                            * or universal character names
                                                            */
char ch_bad = '\k';               /* 'Unrecognized Character Escape' warning issued here
                                   * - \k is not a defined escape sequence or universal character name
                                   */
char *str_bad = "hello \876 \F";  /* Two 'Unrecognized Character Escape' warnings issued here
                                   * - \F is not a defined escape sequence or universal character name
                                   * - \876 is not a defined escape sequence or universal character name
                                   */
char * invalid_codepoint_U = "\U00999999";                /* \Uhhhhhhhh is a universal character name
                                                           * ('Universal Character Name Names Invalid Code Point' warning issued here)
                                                           */
char * invalid_hex = "\xabcd";                            /* \xhhhh is a defined escape sequence
                                                           * ('Bad Character Value' warning issued here)
                                                           */

関連のある設定ファイルパラメータ

設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。

 

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