Statically Enforceable AUTOSAR C++14 Rules Supported by Polyspace Bug Finder
The AUTOSAR C++14 standard classifies the rules that are statically enforceable as Automated and Partially Automated. In total, Polyspace® supports 349 out of 349 1 AUTOSAR C++14 coding rules that are enforceable by a static analysis tool.
Automated Rules
According to the AUTOSAR C++14 standard, static analysis detects all violations of the Automated rules. Polyspace Bug Finder supports 327 out of 327 Automated rules that can be enforced by a static analysis tool. The AUTOSAR C++14 standard contains two Automated rules that cannot be enforced by a static analysis tool.
To find the Automated AUTOSAR C++14:
In the Configuration pane of the Polyspace desktop user interface, locate the Coding Standards and Code Metrics node. Select Set checkers by file and click open. Alternatively, use the command
polyspace-checkers-selection
in the command-line.In the Checkers Selection window, click New to create a new checkers file. Deselect the coding rules that are already selected.
Select AUTOSAR C++14 in the list of coding standards and defects.
Select the checkbox Decidable.
Save your selection as an XML file.
The content of the XML file lists coding rules that the AUTOSAR C++14 standard classifies as Automated.
Partially Automated Rules
According to the AUTOSAR C++14 standard, static analysis detects only a subset of all possible violation of Partially Automated rules. Polyspace Bug Finder supports 22 out of 22 Partially Automated rules. For details about which error scenarios of a rule Polyspace detects, see the Polyspace Implementation section in the reference page of the rule.
Polyspace supports these Partially Automated rules.
AUTOSAR C++14 Rule | Description | Polyspace Checker |
---|---|---|
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 |
See Also
Check AUTOSAR C++
14 (-autosar-cpp14)
Related Topics
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.