C and C++


LANG.PREPROC.NOIF : #ifの欠如

要旨

#else, #elif , #elifdef , #elifndef , #endif に対応する #if が存在しません。

プロパティ

クラス名 No Matching #if
日本語クラス名 #ifの欠如
クラス分類 スタイル (style)
ニーモニック LANG.PREPROC.NOIF
カテゴリー
MisraC2023 MisraC2023:20.14 All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are related
Misra2012 Misra2012:20.14 All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are related
Misra2004 Misra2004:19.17 All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if or #ifdef directive to which they are related
AUTOSARC++14 AUTOSARC++14:M16-1-2 All #else, #elif and #endif pre-processor directives shall reside in the same file as the #if or #ifdef directive to which they are related.
MisraC++2008 MisraC++2008:16-1-2 All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if or #ifdef directive to which they are related.
MisraC++2023 MisraC++2023:19.1.2 All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are related
CWE CWE:710 Improper Adherence to Coding Standards
JPL JPL:23 Place #else, #elif, and #endif in the same file as the matching #if or #ifdef.
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="No Matching #if"

#endif /* 'No Matching #if' warning issued here */

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

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