このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
MISRA C 標準への準拠を検証するためのモデリング ガイドラインとモデル アドバイザー チェック
MISRA C:2012 準拠の概要表で、MISRA C:2012 コーディング標準に対する生成された C コードの準拠に関連するモデリング ガイドラインが示されています。これらのガイドラインとそれに対応するモデル アドバイザー チェックのリストについては、MISRA C:2012 への準拠を検証するための高信頼性システムのモデリング ガイドラインとモデル アドバイザー チェックを参照してください。MISRA C:2012 モデル アドバイザー チェックの MISRA C:2012 Rule または Directive へのマッピングについては、MISRA C:2012 モデル アドバイザー チェックの根拠を参照してください。
MISRA C:2012 モデル アドバイザー チェックの根拠
次の表は、MISRA C:2012 モデル アドバイザー チェックの MISRA C:2012 に基づく根拠を示しています。
モデル アドバイザー チェック | MISRA C:2012 Rule または Directive | |
---|---|---|
MISRA C:2012 のコンフィギュレーション パラメーターをチェック | ||
[固定小数点の正味傾き計算に除算を使用] を [オン] または [整数の逆数の場合にのみ除算を使用] に設定します。 | MISRA C:2012 Rule 10.1: Operands shall not be of an inappropriate essential type. | |
[Inf または NaN のブロックの出力] を [警告] または [エラー] に設定します。 | MISRA C:2012 Directive 4.1: Run-time failures shall be minimized | |
[Model Verification ブロックを有効にする] を [すべて無効] に設定します。 | General recommendation for embedded systems. | |
[指示のないイベント ブロードキャスト] を [エラー] に設定します。 | MISRA C:2012 Rule 17.2: Functions shall not call themselves, either directly or indirectly | |
コンフィギュレーション パラメーター [オーバーフロー時にラップ] を [警告] または [エラー] に設定します。 | MISRA C:2012 Directive 4.1: Run-time failures shall be minimized | |
[製品ハードウェアの符号付き整数の除算の丸め] を [ゼロ方向] または [負方向] に設定します。 | MISRA C:2012 Rule 10.1: Operands shall not be of an inappropriate essential type. | |
[算術シフトとして符号付き整数を右にシフト] をオフにします。 | MISRA C:2012 Rule 10.1: Operands shall not be of an inappropriate essential type. | |
[コンパイル時の MATLAB 関数の再帰限界値] を 0 に設定します。 | MISRA C:2012 Rule 17.2: Functions shall not call themselves, either directly or indirectly | |
[MATLAB 関数での動的メモリ割り当て] をオフにします。 | MISRA C:2012 Directive 4.12: Dynamic memory allocation shall not be used. MISRA C:2012 Rule 21.3: The memory allocation and deallocation functions of <stdlib.h> shall not be used. | |
[MATLAB 関数の実行時再帰を有効にする] をオフにします。 | MISRA C:2012 Rule 17.2: Functions shall not call themselves, either directly or indirectly | |
[ビットフィールド宣言子の型指定子] を uint_T に設定します。 | MISRA C:2012 Rule 6.1: Bit-fields shall only be declared with an appropriate type MISRA C:2012 Rule 6.2: Single-bit named bit fields shall not be of a signed type | |
[キャスト モード] を [標準準拠] に設定します。 | MISRA C:2012 Rules 10.x: The essential type model | |
[コード置換ライブラリ] を | General recommendation for embedded systems. | |
[エクスターナル モード] をオフにします。 | General recommendation for embedded systems. MISRA C:2012 Directive 4.12: Dynamic memory allocation shall not be used MISRA C:2012 Rule 21.3: The memory allocation and deallocation functions of <stdlib.h> shall not be used MISRA C:2012 Rule 21.6: The Standard Library input/output functions shall not be used | |
[共有定数の生成] をオフにします。 | MISRA Rule 8.5: An external object or function shall be declared once in one and only one file | |
[MAT ファイルのログ] をオフにします。 | General recommendation for embedded systems. | |
[識別子の最大の長さ] を実装に応じた制限に設定します。既定の設定は 31 です。 | MISRA C:2012 Rules 5.1-9: 識別子 | |
[かっこのレベル] を [標準 (標準準拠のためのかっこ)] または [最大 (かっこで優先度を指定)] に設定します。 | MISRA C:2012 Rule 12.1: The precedence of operators within expressions should be made explicit | |
[関数宣言に static キーワードを保持] を選択します。 | MISRA Rule 8.7: Functions and objects should not be defined with external linkage if they are referenced in only one translation unit MISRA Rule 8.8: The static storage class specifier shall be used in all declarations of objects and functions that have internal linkage | |
[2 のべき乗での乗算を符号付きのビット単位シフトに置換] をオフにします。 | MISRA C:2012 Rule 10.1: Operands shall not be of an inappropriate essential type | |
[共有コードの配置] を | コンフィギュレーション パラメーター [共有定数の生成] の前提条件 | |
[連続時間のサポート] をオフにします。 | General recommendation for embedded systems. | |
[サポート: 非有限数] をオフにします。 | MISRA C:2012 Directive 4.1: Run-time failures shall be minimized | |
[インラインでない S-Function のサポート] をオフにします。 | General recommendation for embedded systems. | |
[システム生成の識別子] を [短縮形] に設定します。 | MISRA C:2012 5.1: External identifiers shall be distinct MISRA C:2012 5.2: Identifiers declared in the same scope and name space shall be distinct MISRA C:2012 5.4: Macro identifiers shall be distinct MISRA C:2012 5.5: Identifiers shall be distinct from macro names | |
[システム ターゲット ファイル] を ERT ベースのターゲットに設定します。 | General recommendation for embedded systems. | |
[モデルの初期化に動的メモリ割り当てを使用] をオフにします。 [コード インターフェイスのパッケージ化] が | MISRA C:2012 Directive 4.12: Dynamic memory allocation shall not be used. MISRA C:2012 Rule 21.3: The memory allocation and deallocation functions of <stdlib.h> shall not be used. | |
EnableSignedLeftShifts – オフ | MISRA C:2012 Rule 10.1: Operands shall not be of an inappropriate essential type | |
C/C++ 量産コード展開に推奨されないブロックがないかチェック | General recommendation for embedded systems. | |
MISRA C:2012 で推奨されないブロックをチェック | ||
3 次スプライン内挿法または外挿法を使用している Lookup Table ブロック。 具体的には以下のブロックです。
| MISRA C:2012 Rule 11.3: A cast shall not be performed between a pointer to object type and a pointer to a different object type. MISRA C:2012 Rule 11.5: A conversion should not be performed from pointer to void into pointer to object. MISRA C:2012 Rule 11.8: A cast shall not remove any const or volatile qualification from the type pointed to by a pointer. MISRA C:2012 Rule 11.9: The macro NULL shall be the only permitted form of integer null pointer constant. MISRA C:2012 Rule 12.1: The precedence of operators within expressions should be made explicit. | |
推奨されない Lookup Table ブロック。 具体的には以下のブロックです。
| MISRA C:2012 Rule 11.3: A cast shall not be performed between a pointer to object type and a pointer to a different object type. MISRA C:2012 Rule 11.5: A conversion should not be performed from pointer to void into pointer to object. MISRA C:2012 Rule 11.8: A cast shall not remove any const or volatile qualification from the type pointed to by a pointer. MISRA C:2012 Rule 11.9: The macro NULL shall be the only permitted form of integer null pointer constant. MISRA C:2012 Rule 12.1: The precedence of operators within expressions should be made explicit. MISRA C:2012 Rule 12.2: The right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operand. | |
S-Function Builder ブロック | MISRA C:2012 Rule 8.4: A compatible declaration shall be visible when an object or function with external linkage is defined. MISRA C:2012 Rule 8.5: An external object or function shall be declared once in one and only one file. | |
From Workspace ブロック | MISRA C:2012 Rule 18.4: The +, -, += and -= operators should not be applied to an expression of pointer type. | |
String ブロックがモデルまたはサブシステム内で見つかった。 具体的には以下のブロックです。
| MISRA C:2012 Directive 4.7: If a function returns error information, then that error information shall be tested MISRA C:2012 Rule 17.7: The value returned by a function having non-void return type shall be used MISRA C:2012 Rule 21.6: The Standard Library input/output functions shall not be used | |
サポートされていないブロック名のチェック (Simulink Check) | MISRA C:2012 Rule 3.1: The character sequences /* and // shall not be used within a comment. | |
Assignment ブロックの使用をチェック | MISRA C:2012 Rule 9.1: The value of an object with automatic storage duration shall not be read before it has been set. | |
default ケースをもたない switch case 式のチェック | MISRA C:2012 Rule 16.4: Every switch statement shall have a default label. | |
AUTOSAR 受信側インターフェイスの欠落しているエラー ポートのチェック (Simulink Check) | MISRA C:2012 Directive 4.7: If a function returns error information, then that error information shall be tested. MISRA C:2012 Rule 17.7: The value returned by a function having non-void return type shall be used. | |
符号付き整数のビット演算のチェック | MISRA C:2012 Rule 10.1: Operands shall not be of an inappropriate essential type. | |
再帰関数の呼び出しのチェック (Simulink Check) | MISRA C:2012 Rule 17.2: Functions shall not call themselves, either directly or indirectly. | |
浮動小数点値の等式演算と不等式演算のチェック | MISRA C:2012 Directive 1.1: Any implementation-defined behaviour on which the output of the program depends shall be documented and understood. | |
モデル関数内の欠落している const 修飾子をチェック (Simulink Check) | MISRA C:2012 Rule 8.13: A pointer should point to a const-qualified type whenever possible. | |
整数の語長をチェック | MISRA C:2012 Rule 10.1: Operands shall not be of an inappropriate essential type. | |
バス要素の名前として使用されるバス オブジェクト名のチェック (Simulink Check) | MISRA C:2012 Rule 10.1: Operands shall not be of an inappropriate essential type. MISRA C:2012 Rule 5.6: A typedef name shall be a unique identifier. |
MISRA C:2012 への準拠を検証するための高信頼性システムのモデリング ガイドラインとモデル アドバイザー チェック
MathWorks Advisory Board (MAB) によって策定されたモデリング ガイドラインを補強するために、MathWorks® は、高信頼性アプリケーションに焦点を当てた一連のモデリング ガイドラインを公開しています。
高信頼性モデリング ガイドラインの多くには、モデルがガイドラインに準拠していることを検証するために使用できるモデル アドバイザー チェックが含まれています。次の表では、高信頼性モデリング ガイドラインを特定し、対応するモデル アドバイザー チェックを示します。すべてのモデリング ガイドラインに、対応するモデル アドバイザー チェックが含まれているわけではありません。