Required AUTOSAR C++14 Coding Rules Supported by Polyspace Bug Finder
The AUTOSAR C++14 standard classifies the rules that compliant C++ code must follow as Required. Polyspace® Bug Finder supports 337 out of 362 Required AUTOSAR C++14 coding rules.
Supported Required Rules
To find the Required AUTOSAR C++14 coding rules:
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. Optionally, deselect the coding rules that are already selected.
Select AUTOSAR C++14
To select Required coding rules, select the check box Required.
Save your selection as an XML file.
The content of the XML file lists coding rules that AUTOSAR C++14 classifies as Required.
Unsupported Required Rules
Polyspace does not support these Required rules:
Rule | Description |
---|---|
M0-3-1 | Minimization of run-time failures shall be ensured by the use of at least one of:\n (a) static analysis tools/techniques;\n (b) dynamic analysis tools/techniques;\n (c) explicit coding of checks to handle run-time faults. |
M0-4-1 | Use of scaled-integer or fixed-point arithmetic shall be documented. |
M0-4-2 | Use of floating-point arithmetic shall be documented. |
A0-4-1 | Floating-point implementation shall comply with IEEE 754 standard. |
A0-4-3 | The implementations in the chosen compiler shall strictly comply with the C++14 Language Standard. |
M1-0-2 | Multiple compilers shall only be used if they have a common, defined interface. |
A1-1-2 | A warning level of the compilation process shall be set in compliance with project policies. |
A1-1-3 | An optimization option that disregards strict standard compliance shall not be turned on in the chosen compiler. |
A1-2-1 | When using a compiler toolchain (including preprocessor, compiler itself, linker, C++ standard libraries) in safety-related software, the tool confidence level (TCL) shall be determined. In case of TCL2 or TCL3, the compiler shall undergo a "Qualification of a software tool", as per ISO 26262-8.11.4.6 [5]. |
A1-4-1 | Code metrics and their valid boundaries shall be defined and code shall comply with defined boundaries of code metrics. |
A2-7-5 | Comments shall not document any actions or sources (e.g. tables, figures, paragraphs, etc.) that are outside of the file. |
M5-17-1 | The semantic equivalence between a binary operator and its assignment operator form shall be preserved. |
M7-4-1 | All usage of assembler shall be documented. |
M9-6-1 | When the absolute positioning of bits representing a bit-field is required, then the behavior and packing of bit-fields shall be documented. |
A9-6-2 | Bit-fields shall be used only when interfacing to hardware or conforming to communication protocols. |
A10-0-1 | Public inheritance shall be used to implement "is-a" relationship. |
A10-0-2 | Membership or non-public inheritance shall be used to implement "has-a" relationship. |
A15-0-1 | A function shall not exit with an exception if it is able to complete its task. |
A15-0-4 | Unchecked exceptions shall be used to represent errors from which the caller cannot reasonably be expected to recover. |
A15-0-5 | Checked exceptions shall be used to represent errors from which the caller can reasonably be expected to recover. |
A15-0-6 | An analysis shall be performed to analyze the failure modes of exception handling. In particular, the following failure modes shall be analyzed:\n (a) worst time execution time not existing or cannot be determined,\n (b) stack not correctly unwound,\n (c) exception not thrown, other exception thrown, wrong catch activated,\n (d) memory not available while exception handling. |
A15-0-8 | A worst-case execution time (WCET) analysis shall be performed to determine maximum execution time constraints of the software, covering in particular the exceptions processing. |
A15-3-2 | If a function throws an exception, it shall be handled when meaningful actions can be taken, otherwise it shall be propagated. |
A17-0-2 | All project's code including used libraries (including standard and user-defined libraries) and any third-party user code shall conform to the AUTOSAR C++14 Coding Guidelines. |
A18-5-6 | An analysis shall be performed to analyze the failure modes of dynamic memory management. In particular, the following failure modes shall be analyzed:\n (a) non-deterministic behavior resulting with nonexistence of worst-case execution time,\n (b) memory fragmentation,\n (c) running out of memory,\n (d) mismatched allocations and deallocations,\n (e) dependence on non-deterministic calls to kernel. |
See Also
Check AUTOSAR C++
14 (-autosar-cpp14)