C and C++


LANG.PREPROC.STAR : マクロ内で間接参照演算子 * の使用

要旨

マクロの定義で * (間接参照) 演算子を使用しています。

プロパティ

クラス名 Macro Uses Unary * Operator
日本語クラス名 マクロ内で間接参照演算子 * の使用
クラス分類 スタイル (style)
ニーモニック LANG.PREPROC.STAR
カテゴリー
AUTOSARC++14 AUTOSARC++14:A16-0-1 The pre-processor shall only be used for unconditional and conditional file inclusion and include guards, and using the following directives: (1) #ifndef, (2) #ifdef, (3) #if, (4) #if defined, (5) #elif, (6) #else, (7) #define, (8) #endif, (9) #include.
CWE CWE:710 Improper Adherence to Coding Standards
POW10 POW10:9 Limit the use of pointers. Use no more than two levels of dereferencing per expression.
JPL JPL:28 Do not hide dereference operations inside macros or typedefs.
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Macro Uses Unary * Operator"

/* 'Macro Uses Unary * Operator' warning issued on following line */
#define lang_preproc_star(a) \
    (*(a))

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

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