C and C++


LANG.STRUCT.UUMACRO : 未使用のマクロ

要旨

マクロが定義されていますが、定義のスコープ内で使用されていません。

プロパティ

クラス名 Unused Macro
日本語クラス名 未使用のマクロ
クラス分類 スタイル (style)
ニーモニック LANG.STRUCT.UUMACRO
カテゴリー
MisraC2023 MisraC2023:2.5 A project should not contain unused macro declarations
Misra2012 Misra2012:2.5 A project should not contain unused macro declarations
CWE CWE:561 Dead Code
CERT-C CERT-C:MSC12-C Detect and remove code that has no effect or is never executed
DISA-3r10 DISA-3r10:V-6149 The designer will ensure the application does not contain source code that is never invoked during operation, except for software components and libraries from approved third-party products.
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Unused Macro"

解析プロジェクトには1つのファイル fileA.c があるものとします。

#define macro1 1  /* 'Unused Macro' warning issued here */   
#define macro2 1                               /* used in body of myfunc() */  

int myfunc(void){return macro2;}

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

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