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.SCNF : Storage Class Not First

要旨

A declaration contains an auto, extern, static, register, or typedef specifier, but that specifier is not the first one in the declaration.

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

プロパティ

クラス名 Storage Class Not First
日本語クラス名 Storage Class Not First
クラス分類 スタイル (style)
ニーモニック PARSE.SCNF
カテゴリー
AUTOSARC++14 AUTOSARC++14:A7-1-8 A non-type specifier shall be placed before a type specifier in a declaration.
CWE CWE:1076 Insufficient Adherence to Expected Conventions
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Storage Class Not First"

typedef const int myint;                                          /* 'typedef' appears first */
int typedef const myotherint;       /* 'Storage Class Not First' warning issued here */

static int si_good;                                               /* 'static' appears first */
int static si_bad;                  /* 'Storage Class Not First' warning issued here */

extern int ei_good;                                               /* 'extern' appears first */
int extern ei_bad;                  /* 'Storage Class Not First' warning issued here */

int static f(void){                 /* 'Storage Class Not First' warning issued here */
    auto int ai_good = 1;                                         /* 'auto' appears first */
    int auto ai_bad = 2;            /* 'Storage Class Not First' warning issued here */
    register int ri_good = 3;                                     /* 'register' appears first
                                                                   * ('Register Keyword' warning issued here )
                                                                   */
    int register ir_bad = 4;        /* 'Storage Class Not First' warning issued here
                                     *  ('Register Keyword' warning also issued)
                                     */
    const register int cri_bad = 5; /* 'Storage Class Not First' warning issued here
                                     *  ('Register Keyword' warning also issued)
                                     */
    return ai_good + ai_bad + ri_good + ir_bad + cri_bad;
}

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

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

 

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