PolyspaceBug Finder でサポートされている静的に強制可能な AUTOSAR C++14 ルール
AUTOSAR C++14 規約では、静的に強制可能なルールが "Automated" および "Partially automated" として分類されます。Polyspace® は合計で、349 件のうち 349 件をサポートしています。 1 静的解析ツールで強制可能な AUTOSAR C++14 コーディング ルール。
Automated ルール
AUTOSAR C++14 規約に基づき、静的解析ツールは "Automated" ルールのすべての違反を検出します。Polyspace Bug Finder は、静的解析ツールで強制可能な "Automated" ルール 327 件のうち、327 件をサポートしています。AUTOSAR C++14 規約には、静的解析ツールで強制不可能な "Automated" ルール 2 件が含まれています。
"Automated" AUTOSAR C++14 を確認するには、次のようにします。
Polyspace デスクトップ ユーザー インターフェイスの [構成] ペインで [コーディング規約およびコード メトリクス] ノードを見つけます。[ファイルごとにチェッカーを設定] を選択して [開く] をクリックします。あるいはコマンド ラインでコマンド
polyspace-checkers-selection
を使用します。新しいチェッカー ファイルを作成するため、[チェッカーの選択] ウィンドウで [新規] をクリックします。すでに選択されているコーディング ルールを選択解除します。
コーディング規約と欠陥のリストで [AUTOSAR C++14] を選択します。
[決定可能] チェックボックスをオンにします。
選択したルールを XML ファイルとして保存します。
XML ファイルには、AUTOSAR C++14 規約により "Automated" に分類されるコーディング ルールがリストされています。
Partially Automated ルール
AUTOSAR C++14 規約に基づき、静的解析ツールは "Partially Automated" ルールに対するすべての潜在的な違反のサブセットのみを検出します。Polyspace Bug Finder は、"Partially Automated" ルール 22 件のうち 22 件をサポートしています。Polyspace が検出するルールのエラー シナリオの詳細については、そのルールのリファレンス ページの [Polyspace 実装] セクションを参照してください。
Polyspace は次の "Partially Automated" ルールをサポートしています。
AUTOSAR C++14 Rule | 説明 | Polyspace チェッカー |
---|---|---|
AUTOSAR C++14 Rule A0-4-4 | Range, domain and pole errors shall be checked when using math functions | AUTOSAR C++14 Rule A0-4-4 |
AUTOSAR C++14 Rule A12-0-2 | Bitwise operations and operations that assume data representation in memory shall not be performed on objects | AUTOSAR C++14 Rule A12-0-2 |
AUTOSAR C++14 Rule A12-1-5 | Common class initialization for non-constant members shall be done by a delegating constructor | AUTOSAR C++14 Rule A12-1-5 |
AUTOSAR C++14 Rule A12-8-3 | Moved-from object shall not be read-accessed | AUTOSAR C++14 Rule A12-8-3 |
AUTOSAR C++14 Rule A14-5-2 | Class members that are not dependent on template class parameters should be defined in a separate base class | AUTOSAR C++14 Rule A14-5-2 |
AUTOSAR C++14 Rule A15-0-2 | At least the basic guarantee for exception safety shall be provided for all operations.In addition, each function may offer either the strong guarantee or the nothrow guarantee | AUTOSAR C++14 Rule A15-0-2 |
AUTOSAR C++14 Rule A15-0-7 | Exception handling mechanism shall guarantee a deterministic worst-case time execution time | AUTOSAR C++14 Rule A15-0-7 |
AUTOSAR C++14 Rule A15-1-4 | If a function exits with an exception, then before a throw, the function shall place all objects/resources that the function constructed in valid states or it shall delete them. | AUTOSAR C++14 Rule A15-1-4 |
AUTOSAR C++14 Rule A15-2-2 | If a constructor is not noexcept and the constructor cannot finish object initialization, then it shall deallocate the object's resources and it shall throw an exception | AUTOSAR C++14 Rule A15-2-2 |
AUTOSAR C++14 Rule A15-3-3 | Main function and a task main function shall catch at least: base class exceptions from all third-party libraries used, std::exception and all otherwise unhandled exceptions | AUTOSAR C++14 Rule A15-3-3 |
AUTOSAR C++14 Rule A15-5-2 | Program shall not be abruptly terminated.In particular, an implicit or explicit invocation of std::abort(), std::quick_exit(), std::_Exit(), std::terminate() shall not be done | AUTOSAR C++14 Rule A15-5-2 |
AUTOSAR C++14 Rule A18-5-2 | Non-placement new or delete expressions shall not be used | AUTOSAR C++14 Rule A18-5-2 |
AUTOSAR C++14 Rule A18-5-5 | Memory management functions shall ensure the following: (a) deterministic behavior resulting with the existence of worst-case execution time, (b) avoiding memory fragmentation, (c) avoid running out of memory, (d) avoiding mismatched allocations or deallocations, (e) no dependence on non-deterministic calls to kernel | AUTOSAR C++14 Rule A18-5-5 |
AUTOSAR C++14 Rule A18-5-8 | Objects that do not outlive a function shall have automatic storage duration | AUTOSAR C++14 Rule A18-5-8 |
AUTOSAR C++14 Rule A3-1-5 | A function definition shall only be placed in a class definition if (1) the function is intended to be inlined (2) it is a member function template (3) it is a member function of a class template | AUTOSAR C++14 Rule A3-1-5 |
AUTOSAR C++14 Rule A5-1-1 | Literal values shall not be used apart from type initialization, otherwise symbolic names shall be used instead | AUTOSAR C++14 Rule A5-1-1 |
AUTOSAR C++14 Rule A5-3-2 | Null pointers shall not be dereferenced | AUTOSAR C++14 Rule A5-3-2 |
AUTOSAR C++14 Rule A9-3-1 | Member functions shall not return non-constant "raw" pointers or references to private or protected data owned by the class | AUTOSAR C++14 Rule A9-3-1 |
AUTOSAR C++14 Rule A9-6-1 | Data types used for interfacing with hardware or conforming to communication protocols shall be trivial, standard-layout and only contain members of types with defined sizes | AUTOSAR C++14 Rule A9-6-1 |
AUTOSAR C++14 Rule M5-0-2 | Limited dependence should be placed on C++ operator precedence rules in expressions. | AUTOSAR C++14 Rule M5-0-2 |
AUTOSAR C++14 Rule M5-8-1 | The right hand operand of a shift operator shall lie between zero and one less than the width in bits of the underlying type of the left hand operand. | AUTOSAR C++14 Rule M5-8-1 |
AUTOSAR C++14 Rule M6-2-2 | Floating-point expressions shall not be directly or indirectly tested for equality or inequality. | AUTOSAR C++14 Rule M6-2-2 |
参考
AUTOSAR C++14 をチェック (-autosar-cpp14)
トピック
1 The AUTOSAR C++14 standard contains 351 statically enforceable rules. The rules A0-4-3 and A1-4-3 are not enforceable by a static analysis tool. These rules might be enforced by your compiler.