C and C++


LANG.STRUCT.DECL.ML : 一行に複数の宣言文

要旨

一行もしくは一命令文に二つ以上の宣言文が含まれています。

プロパティ

クラス名 Multiple Declarations On Line
日本語クラス名 一行に複数の宣言文
クラス分類 スタイル (style)
ニーモニック LANG.STRUCT.DECL.ML
カテゴリー
AUTOSARC++14 AUTOSARC++14:A7-1-7 Each expression statement and identifier declaration shall be placed on a separate line.
MisraC++2023 MisraC++2023:10.0.1 A declaration shall not declare more than one variable or member variable
CWE CWE:1078 Inappropriate Source Code Style or Formatting
CERT-C CERT-C:DCL04-C Do not declare more than one variable per declaration
JSF++ JSF++:152 Multiple variable declarations shall not be allowed on the same line.
JPL JPL:24 Place no more than one statement or declaration per line of text.
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっており、プロジェクトには非正規の C向けAST が必要になります。有効にするにはプロジェクト設定ファイル (configuration file) に以下の WARNING_FILTER ルールと RETAIN_UNNORMALIZED_C_AST 設定を追加してください。
RETAIN_UNNORMALIZED_C_AST = Yes
WARNING_FILTER += allow class="Multiple Declarations On Line"
注:非正規化された AST を継続して使用した場合、使用ディスク容量が増加し解析時間が長くなる可能性があります。

int i, j; /* 'Multiple Declarations On Line' warning issued here */

int a,    /* 'Multiple Declarations On Line' warning issued here */
    b;

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

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