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++


LANG.PREPROC.CBI : #includeの前のコード

要旨

#include 前処理指令の前にコードがあります。

プロパティ

クラス名 Code Before #include
日本語クラス名 #includeの前のコード
クラス分類 スタイル (style)
ニーモニック LANG.PREPROC.CBI
カテゴリー
MisraC2025 MisraC2025:20.1 #include directives should only be preceded by preprocessor directives or comments
MisraC2023 MisraC2023:20.1 #include directives should only be preceded by preprocessor directives or comments
Misra2012 Misra2012:20.1 #include directives should only be preceded by preprocessor directives or comments
Misra2004 Misra2004:19.1 #include statements in a file should only be preceded by other preprocessor directives or comments
AUTOSARC++14 AUTOSARC++14:M16-0-1 #include directives in a file shall only be preceded by other pre-processor directives or comments.
MisraC++2008 MisraC++2008:16-0-1 #include directives in a file shall only be preceded by preprocessor directives or comments.
MisraC++2023 MisraC++2023:19.0.3 #include directives should only be preceded by preprocessor directives or comments
CWE CWE:710 Improper Adherence to Coding Standards
JPL JPL:31 Do not place code or declarations before an #include directive.
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Code Before #include"

#include <stdlib.h>

static const int errflag=0xdeadbeef; /* 'Code Before #include' warning issued here */

#include <stdio.h>

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

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

 

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