コード生成向けにサポートされている MISRA C:2023 コーディング命令およびルール
MATLAB® コードから C コードを生成するとき、MISRA™ C:2023 ガイドラインの "必要" と "必須" のコーディング ルールに最大限準拠したコードを生成するようにコード ジェネレーターを構成できます。
MISRA C:2023 規約では、次のガイドラインが統合されています。
MISRA C:2012 ルールおよび命令
MISRA C:2012 Technical Corrigendum 1 (TC1) および Technical Corrigendum 2 (TC2) で明確化された項目
MISRA C:2012 Amendment 1 (AMD1)、Amendment 2 (AMD2)、Amendment 3 (AMD3)、Amendment 4 (AMD4) で追加された新しいルールおよび変更
以下の表は、MISRA C:2012 Amendment 4 のルールを除く、MISRA C:2023 規格の "必要" と "必須" のすべてのコーディング命令およびルールをリストしたものです。これらの表の "カテゴリ" 列は、MISRA ガイドラインの付録 E の規定に従って自動生成コードに適用されます。
それぞれの命令またはルールについて、"準拠" 列は次のエントリのいずれかになります。
準拠: 生成コードはこの命令/ルールに準拠します。
非準拠: 状況によっては、生成コードがこの命令/ルールに準拠しないことがあります。
該当なし: この命令/ルールはコード生成プロセスに該当しません。これらの命令/ルールの一部について、生成コードの準拠性を高めるために実行できる推奨されるアクションを "追加メモ" セクションに示してあります。
メモ
これらの表では、既に次の手順に従って生成コードの MISRA への準拠を最大限に高めていることを前提としています。
コード生成構成プロパティを推奨値に設定する。これは、コマンド ラインまたは MATLAB Coder™ アプリのいずれかで実行できます。Configure Code Generation Configuration Object Properties at Command LineおよびConfigure MATLAB Coder App Settingsを参照してください。
coder.cevalを使用して生成コードと統合するユーザー記述の C/C++ ファイルまたはサードパーティの C/C++ ファイルが MISRA ガイドラインに準拠していることを確認する。
生成コードに、MISRA ガイドラインに準拠しないファイルが 1 つ以上含まれることがあります。それらのファイルの完全な一覧については、Scope of Code Generation Supportを参照してください。
特定の状況では、rtwtypes.h ファイルに含まれるカスタム型定義を生成コードで使用しないようにコード ジェネレーターを構成できる場合があります。例については、Additional Settings for MISRA C++ Complianceを参照してください。
これらの表の情報は、Simulink® モデルの MATLAB Function ブロックおよび MATLAB System ブロックの内部の MATLAB コードに対して生成される C コードには適用されません。Simulink モデルから生成されるコードの MISRA への準拠の詳細については、MISRA C:2023 準拠の概要表を参照してください。
コード ジェネレーターは、これらのルールを Polyspace® Bug Finder™ 製品と同じ方法で解釈します。特定のコーディング ルールがコード ジェネレーターでどのように解釈されるかについては、Polyspace Bug Finder ドキュメンテーション (MISRA C:2023 命令およびルール (Polyspace Bug Finder)) の対応するリファレンス ページで "Polyspace 実装" のセクションを参照してください。
実装
コンパイルとビルド
要件のトレーサビリティ
| 命令 | 説明a | カテゴリ | 準拠 | 追加メモ |
|---|---|---|---|---|
| 命令 3.1 | All code shall be traceable to documented requirements. | 必要 | 該当なし | 生成コードを準拠させるには、Requirements Toolbox™ を使用して、要件に関する情報を含むコメントを生成コードに含めます。Requirements Traceability for Code Generated from MATLAB Code (Requirements Toolbox)を参照してください。 |
a Copyright © The MISRA Consortium Limited, 2023. | ||||
コード設計
| 命令 | 説明a | カテゴリ | 準拠 | 追加メモ |
|---|---|---|---|---|
| 命令 4.1 | Run-time failures shall be minimized. | 必要 | 非準拠 | |
| 命令 4.3 | Assembly language shall be encapsulated and isolated. | 必要 | 準拠 | |
| 命令 4.7 | If a function returns error information, then that error information shall be tested. | 必要 | 非準拠 | この違反を減らすには、MATLAB コードで、 |
| 命令 4.10 | Precautions shall be taken in order to prevent the contents of a header file being included more than once. | 必要 | 準拠 | |
| 命令 4.11 | The validity of values passed to library functions shall be checked. | 必要 | 非準拠 | この違反を減らすには、MATLAB コードで、 |
| 命令 4.12 | Dynamic memory allocation shall not be used. | 必要 | 準拠 | |
| 命令 4.14 | The validity of values received from external sources shall be checked. | 必要 | 非準拠 | この違反を減らすには、MATLAB コードで、 |
| 命令 4.15 | Evaluation of floating-point expressions shall not lead to the undetected generation of infinities and NaNs. | 必要 | 非準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. | ||||
標準 C 環境
| ルール | 説明a | カテゴリ | 準拠 | 追加メモ |
|---|---|---|---|---|
| 1.1 | The program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limits. | 必要 | 準拠 | |
| 1.3 | There shall be no occurrence of undefined or critical unspecified behavior. | 必要 | 準拠 | |
| 1.4 | Emergent language features shall not be used. | 必要 | 準拠 | |
| 1.5 | Obsolescent language features shall not be used. | 必要 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. | ||||
未使用コード
コメント
| ルール | 説明a | カテゴリ | 準拠 | 追加メモ |
|---|---|---|---|---|
| 3.1 | The character sequences /* and // shall not be used within a comment. | 必要 | 非準拠 | この違反を減らすには、MATLAB コードまたは外部 C/C+ コードに含めるコメントがこのルールを満たすことを確認します。 あるいは、構成プロパティ |
| 3.2 | Line-splicing shall not be used in // comments. | 必要 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. | ||||
文字セットと字句規則
識別子
| ルール | 説明a | カテゴリb | 準拠 | 追加メモ |
|---|---|---|---|---|
| 5.1 | External identifiers shall be distinct. | 必要 | 非準拠 | この違反を減らすには、MATLAB エントリポイント関数の名前が 5 文字未満であることを確認します。 |
| 5.2 | Identifiers declared in the same scope and name space shall be distinct. | 必要 | 準拠 | |
| 5.3 | An identifier declared in an inner scope shall not hide an identifier declared in an outer scope. | 勧告 | 準拠 | |
| 5.4 | Macro identifiers shall be distinct. | 必要 | 準拠 | |
| 5.5 | Identifiers shall be distinct from macro names. | 必要 | 準拠 | |
| 5.6 | A typedef name shall be a unique identifier. | 必要 | 準拠 | |
| 5.7 | A tag name shall be a unique identifier. | 必要 | 準拠 | |
| 5.8 | Identifiers that define objects or functions with external linkage shall be unique. | 必要 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. b Guideline identifies Rule 5.3 as Required for manually generated code. | ||||
型
リテラルと定数
| ルール | 説明a | カテゴリb | 準拠 | 追加メモ |
|---|---|---|---|---|
| 7.1 | Octal constants shall not be used. | 勧告 | 準拠 | |
| 7.2 | A "u" or "U" suffix shall be applied to all integer constants that are represented in an unsigned type. | 可読性 | 準拠 | |
| 7.3 | The lowercase character "l" shall not be used in a literal suffix. | 可読性 | 準拠 | |
| 7.4 | A string literal shall not be assigned to an object unless the object's type is "pointer to const-qualified char". | 必要 | 準拠 | |
| 7.5 | The argument of an integer constant macro shall have an appropriate form. | 必須 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. b Guideline identifies Rules 7.1, 7.2, and 7.3 as Required for manually generated code. | ||||
宣言と定義
| ルール | 説明a | カテゴリb | 準拠 | 追加メモ |
|---|---|---|---|---|
| 8.1 | Types shall be explicitly specified. | 必要 | 準拠 | |
| 8.2 | Function types shall be in prototype form with named parameters. | 必要 | 準拠 | |
| 8.3 | All declarations of an object or function shall use the same names and type qualifiers. | 必要 | 準拠 | |
| 8.4 | A compatible declaration shall be visible when an object or function with external linkage is defined. | 勧告 | 準拠 | |
| 8.5 | An external object or function shall be declared once in one and only one file. | 勧告 | 準拠 | |
| 8.6 | An identifier with external linkage shall have exactly one external definition. | 必要 | 準拠 | |
| 8.8 | The static storage class specifier shall be used in all declarations of objects and functions that have internal linkage. | 必要 | 準拠 | |
| 8.10 | An inline function shall be declared with the static storage class. | 必要 | 準拠 | |
| 8.12 | Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique. | 必要 | 準拠 | |
| 8.14 | The restrict type qualifier shall not be used. | 勧告 | 準拠 | |
| 8.15 | All declarations of an object with an explicit alignment specification shall specify the same alignment. | 必要 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. b Guideline identifies Rule 8.4, 8.5, and 8.14 as Required for manually generated code. | ||||
初期化
| ルール | 説明a | カテゴリb | 準拠 | 追加メモ |
|---|---|---|---|---|
| 9.1 | The value of an object with automatic storage duration shall not be read before it has been set. | 必須 | 非準拠 | |
| 9.2 | The initializer for an aggregate or union shall be enclosed in braces. | 可読性 | 準拠 | |
| 9.3 | Arrays shall not be partially initialized. | 可読性 | 準拠 | |
| 9.4 | An element of an object shall not be initialized more than once. | 必要 | 準拠 | |
| 9.5 | Where designated initializers are used to initialize an array object the size of the array shall be specified explicitly. | 可読性 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. b Guideline identifies Rule 9.2, 9.3, and 9.5 as Required for manually generated code. | ||||
実質的な型モデル
| ルール | 説明a | カテゴリb | 準拠 | 追加メモ |
|---|---|---|---|---|
| 10.1 | Operands shall not be of an inappropriate essential type. | 勧告 | 準拠 | |
| 10.2 | Expressions of essentially character type shall not be used inappropriately in addition and subtraction operations. | 勧告 | 準拠 | |
| 10.3 | The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category. | 勧告 | 準拠 | |
| 10.4 | Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category. | 勧告 | 準拠 | |
| 10.6 | The value of a composite expression shall not be assigned to an object with wider essential type. | 勧告 | 準拠 | |
| 10.7 | If a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential type. | 勧告 | 準拠 | |
| 10.8 | The value of a composite expression shall not be cast to a different essential type category or a wider essential type. | 勧告 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. b Guideline identifies Rule 10.1, 10.2, 10.3, 10.4, 10.6, 10.7, and 10.8 as Required for manually generated code. | ||||
ポインター型の変換
| ルール | 説明a | カテゴリb | 準拠 | 追加メモ |
|---|---|---|---|---|
| 11.1 | Conversions shall not be performed between a pointer to a function and any other type. | 必要 | 準拠 | |
| 11.2 | Conversions shall not be performed between a pointer to an incomplete type and any other type. | 必要 | 準拠 | |
| 11.3 | A cast shall not be performed between a pointer to object type and a pointer to a different object type. | 必要 | 非準拠 | |
| 11.6 | A cast shall not be performed between pointer to void and an arithmetic type. | 必要 | 準拠 | |
| 11.7 | A cast shall not be performed between pointer to object and a non-integer arithmetic type. | 必要 | 準拠 | |
| 11.8 | A cast shall not remove any const or volatile qualification from the type pointed to by a pointer. | 必要 | 非準拠 | |
| 11.9 | The macro NULL shall be the only permitted form of integer null pointer constant. | 可読性 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. b Guideline identifies Rule 11.9 as Required for manually generated code. | ||||
式
| ルール | 説明a | カテゴリ | 準拠 | 追加メモ |
|---|---|---|---|---|
| 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. | 必要 | 非準拠 | |
| 12.5 | The sizeof operator shall not have an operand which is a function parameter declared as "array of type". | 必須 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. | ||||
副作用
| ルール | 説明a | カテゴリ | 準拠 | 追加メモ |
|---|---|---|---|---|
| 13.1 | Initializer lists shall not contain persistent side effects. | 必要 | 準拠 | |
| 13.2 | The value of an expression and its persistent side effects shall be the same under all permitted evaluation orders. | 必要 | 非準拠 | |
| 13.5 | The right hand operand of a logical && or || operator shall not contain persistent side effects. | 必要 | 非準拠 | 特定の状況では、生成コードのスタック使用量を減らすために、ローカル変数がコード ジェネレーターによって静的ローカル変数にプロモートされます。このプロモーションにより、生成コードがこのルールに違反することがあります。
|
| 13.6 | The operand of the sizeof operator shall not contain any expression which has potential side effects. | 必要 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. | ||||
コントロール ステートメントの式
| ルール | 説明a | カテゴリb | 準拠 | 追加メモ |
|---|---|---|---|---|
| 14.1 | A loop counter shall not have essentially floating type. | 勧告 | 準拠 | |
| 14.2 | A for loop shall be well-formed. | 可読性 | 準拠 | |
| 14.3 | Controlling expressions shall not be invariant. | 必要 | 非準拠 | |
| 14.4 | The controlling expression of an if statement and the controlling expression of an iteration-statement shall have essentially Boolean type. | 勧告 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. b Guideline identifies Rule 14.1, 14.2, and 14.4 as Required for manually generated code. | ||||
フロー制御
| ルール | 説明a | カテゴリb | 準拠 | 追加メモ |
|---|---|---|---|---|
| 15.2 | The goto statement shall jump to a label declared later in the same function. | 勧告 | 準拠 | |
| 15.3 | Any label referenced by a goto statement shall be declared in the same block, or in any block enclosing the goto statement. | 勧告 | 準拠 | |
| 15.6 | The body of an iteration-statement or a selection-statement shall be a compound-statement. | 必要 | 準拠 | |
| 15.7 | All if ... else if constructs shall be terminated with an else statement. | 可読性 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. b Guideline identifies Rule 15.2, 15.3, and 15.7 as Required for manually generated code. | ||||
switch ステートメント
| ルール | 説明a | カテゴリb | 準拠 | 追加メモ |
|---|---|---|---|---|
| 16.1 | All switch statements shall be well-formed. | 勧告 | 準拠 | |
| 16.2 | A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement. | 勧告 | 準拠 | |
| 16.3 | An unconditional break statement shall terminate every switch-clause. | 勧告 | 準拠 | |
| 16.4 | Every switch statement shall have a default label. | 勧告 | 準拠 | |
| 16.5 | A default label shall appear as either the first or the last switch label of a switch statement. | 勧告 | 準拠 | |
| 16.6 | Every switch statement shall have at least two switch-clauses. | 勧告 | 準拠 | |
| 16.7 | A switch-expression shall not have essentially Boolean type. | 勧告 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. b Guideline identifies Rule 16.1, 16.2, 16.3, 16.4, 16.5, 16.6, and 16.7 as Required for manually generated code. | ||||
関数
| ルール | 説明a | カテゴリb | 準拠 | 追加メモ |
|---|---|---|---|---|
| 17.1 | The features of <stdarg.h> shall not be used. | 必要 | 準拠 | |
| 17.2 | Functions shall not call themselves, either directly or indirectly. | 必要 | 準拠 | |
| 17.3 | A function shall not be declared implicitly. | 必須 | 準拠 | |
| 17.4 | All exit paths from a function with non-void return type shall have an explicit return statement with an expression. | 必須 | 準拠 | |
| 17.5 | The function argument corresponding to a parameter declared to have an array type shall have an appropriate number of elements. | 必要 | 準拠 | |
| 17.6 | The declaration of an array parameter shall not contain the static keyword between the [ ]. | 必須 | 準拠 | |
| 17.7 | The value returned by a function having non-void return type shall be used. | 可読性 | 準拠 | |
| 17.9 | A function declared with a _Noreturn function specifier shall not return to its caller. | 必須 | 準拠 | |
| 17.10 | A function declared with a _Noreturn function specifier shall have void return type. | 必要 | 準拠 | |
| 17.13 | A function type shall not be type qualified. | 必要 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. b Guideline identifies Rule 17.7 as Required for manually generated code. | ||||
ポインターと配列
| ルール | 説明a | カテゴリ | 準拠 | 追加メモ |
|---|---|---|---|---|
| 18.1 | A pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operand. | 必要 | 非準拠 | |
| 18.2 | Subtraction between pointers shall only be applied to pointers that address elements of the same array. | 必要 | 準拠 | |
| 18.3 | The relational operators >, >=, < and <= shall not be applied to objects of pointer type except where they point into the same object. | 必要 | 準拠 | |
| 18.6 | The address of an object with automatic storage shall not be copied to another object that persists after the first object has ceased to exist. | 必要 | 非準拠 | |
| 18.7 | Flexible array members shall not be declared. | 必要 | 準拠 | |
| 18.8 | Variable-length array types shall not be used. | 必要 | 準拠 | |
| 18.9 | An object with temporary lifetime shall not undergo array-to-pointer conversion. | 必要 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. | ||||
重複するストレージ
プリプロセッサ命令
| ルール | 説明a | カテゴリ | 準拠 | 追加メモ |
|---|---|---|---|---|
| 20.2 | The ', " or \ characters and the /* or // character sequences shall not occur in a header file name. | 必要 | 準拠 | |
| 20.3 | The #include directive shall be followed by either a <filename> or "filename"sequence. | 必要 | 準拠 | |
| 20.4 | A macro shall not be defined with the same name as a keyword. | 必要 | 準拠 | |
| 20.6 | Tokens that look like a preprocessing directive shall not occur within a macro argument. | 必要 | 準拠 | |
| 20.7 | Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses. | 必要 | 準拠 | |
| 20.8 | The controlling expression of a #if or #elif preprocessing directive shall evaluate to 0 or 1. | 必要 | 準拠 | |
| 20.9 | All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define'd before evaluation. | 必要 | 準拠 | |
| 20.11 | A macro parameter immediately following a # operator shall not immediately be followed by a ## operator. | 必要 | 準拠 | |
| 20.12 | A macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operators. | 必要 | 準拠 | |
| 20.13 | A line whose first token is # shall be a valid preprocessing directive. | 必要 | 準拠 | |
| 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. | 必要 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. | ||||
標準ライブラリ
| ルール | 説明a | カテゴリ | 準拠 | 追加メモ |
|---|---|---|---|---|
| 21.1 | #define and #undef shall not be used on a reserved identifier or reserved macro name. | 必要 | 準拠 | |
| 21.2 | A reserved identifier or reserved macro name shall not be declared. | 必要 | 準拠 | |
| 21.3 | The memory allocation and deallocation functions of <stdlib.h> shall not be used. | 必要 | 準拠 | |
| 21.4 | The standard header file <setjmp.h> shall not be used. | 必要 | 準拠 | |
| 21.5 | The standard header file <signal.h> shall not be used. | 必要 | 準拠 | |
| 21.6 | The Standard Library input/output functions shall not be used. | 必要 | 非準拠 | この違反を減らすには、MATLAB コードで、 |
| 21.7 | The Standard Library functions atof, atoi, atol and atoll of <stdlib.h> shall not be used. | 必要 | 準拠 | |
| 21.8 | The Standard Library termination functions of <stdlib.h> shall not be used. | 必要 | 準拠 | |
| 21.9 | The Standard Library functions bsearch and qsort of <stdlib.h> shall not be used. | 必要 | 準拠 | |
| 21.10 | The Standard Library time and date functions shall not be used. | 必要 | 非準拠 | この違反を減らすには、MATLAB コードで、 |
| 21.12 | The standard header file <fenv.h> shall not be used. | 必要 | 準拠 | |
| 21.13 | Any value passed to a function in <ctype.h> shall be representable as an unsigned char or be the value EOF. | 必須 | 準拠 | |
| 21.14 | The Standard Library function memcmp shall not be used to compare null terminated strings. | 必要 | 準拠 | |
| 21.15 | The pointer arguments to the Standard Library functions memcpy, memmove and memcmp shall be pointers to qualified or unqualified versions of compatible types. | 必要 | 準拠 | |
| 21.16 | The pointer arguments to the Standard Library function memcmp shall point to either a pointer type, an essentially signed type, an essentially unsigned type, an essentially Boolean type or an essentially enum type. | 必要 | 非準拠 | |
| 21.17 | Use of the string handling functions from <string.h> shall not result in accesses beyond the bounds of the objects referenced by their pointer parameters. | 必須 | 準拠 | |
| 21.18 | The size_t argument passed to any function in <string.h> shall have an appropriate value. | 必須 | 非準拠 | |
| 21.19 | The pointers returned by the Standard Library functions localeconv, getenv, setlocale or, strerror shall only be used as if they have pointer to const-qualified type. | 必須 | 準拠 | |
| 21.20 | The pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale or strerror shall not be used following a subsequent call to the same function. | 必須 | 準拠 | |
| 21.21 | The Standard Library function system of <stdlib.h> shall not be used. | 必要 | 準拠 | |
| 21.22 | All operand arguments to any type-generic macros declared in <tgmath.h> shall have an appropriate essential type. | 必須 | 準拠 | |
| 21.23 | All operand arguments to any multi-argument type-generic macros declared in <tgmath.h> shall have the same standard type. | 必要 | 準拠 | |
| 21.24 | The random number generator functions of <stdlib.h> shall not be used. | 必要 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. | ||||
リソース
| ルール | 説明a | カテゴリ | 準拠 | 追加メモ |
|---|---|---|---|---|
| 22.1 | All resources obtained dynamically by means of Standard Library functions shall be explicitly released. | 必要 | 準拠 | |
| 22.2 | A block of memory shall only be freed if it was allocated by means of a Standard Library function. | 必須 | 準拠 | |
| 22.3 | The same file shall not be open for read and write access at the same time on different streams. | 必要 | 準拠 | |
| 22.4 | There shall be no attempt to write to a stream which has been opened as read-only. | 必須 | 準拠 | |
| 22.5 | A pointer to a FILE object shall not be dereferenced. | 必須 | 準拠 | |
| 22.6 | The value of a pointer to a FILE shall not be used after the associated stream has been closed. | 必須 | 準拠 | |
| 22.7 | The macro EOF shall only be compared with the unmodified return value from any Standard Library function capable of returning EOF. | 必要 | 準拠 | |
| 22.8 | The value of errno shall be set to zero prior to a call to an errno-setting-function. | 必要 | 準拠 | |
| 22.9 | The value of errno shall be tested against zero after calling an errno-setting-function. | 必要 | 準拠 | |
| 22.10 | The value of errno shall only be tested when the last function to be called was an errno-setting-function. | 必要 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. | ||||
総称選択
| ルール | 説明a | カテゴリ | 準拠 | 追加メモ |
|---|---|---|---|---|
| 23.2 | A generic selection that is not expanded from a macro shall not contain potential side effects in the controlling expression. | 必要 | 準拠 | |
| 23.4 | A generic association shall list an appropriate type. | 必要 | 準拠 | |
| 23.6 | The controlling expression of a generic selection shall have an essential type that matches its standard type. | 必要 | 準拠 | |
| 23.8 | A default association shall appear as either the first or the last association of a generic selection. | 必要 | 準拠 | |
a Copyright © The MISRA Consortium Limited, 2023. | ||||
参考
coder.EmbeddedCodeConfig | coder.setupMISRAConfig
トピック
- Generate C/C++ Code with Improved MISRA and AUTOSAR Compliance
- コード生成向けにサポートされている MISRA C:2012 コーディング命令およびルール