Main Content

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:

  1. 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.

  2. In the Checkers Selection window, click New to create a new checkers file. Optionally, deselect the coding rules that are already selected.

  3. Select AUTOSAR C++14

  4. To select Required coding rules, select the check box Required.

  5. 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:

RuleDescription
M0-3-1Minimization 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-1Use of scaled-integer or fixed-point arithmetic shall be documented.
M0-4-2Use of floating-point arithmetic shall be documented.
A0-4-1Floating-point implementation shall comply with IEEE 754 standard.
A0-4-3The implementations in the chosen compiler shall strictly comply with the C++14 Language Standard.
M1-0-2Multiple compilers shall only be used if they have a common, defined interface.
A1-1-2A warning level of the compilation process shall be set in compliance with project policies.
A1-1-3An optimization option that disregards strict standard compliance shall not be turned on in the chosen compiler.
A1-2-1When 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-1Code metrics and their valid boundaries shall be defined and code shall comply with defined boundaries of code metrics.
A2-7-5Comments shall not document any actions or sources (e.g. tables, figures, paragraphs, etc.) that are outside of the file.
M5-17-1The semantic equivalence between a binary operator and its assignment operator form shall be preserved.
M7-4-1All usage of assembler shall be documented.
M9-6-1When the absolute positioning of bits representing a bit-field is required, then the behavior and packing of bit-fields shall be documented.
A9-6-2Bit-fields shall be used only when interfacing to hardware or conforming to communication protocols.
A10-0-1Public inheritance shall be used to implement "is-a" relationship.
A10-0-2Membership or non-public inheritance shall be used to implement "has-a" relationship.
A15-0-1A function shall not exit with an exception if it is able to complete its task.
A15-0-4Unchecked exceptions shall be used to represent errors from which the caller cannot reasonably be expected to recover.
A15-0-5Checked exceptions shall be used to represent errors from which the caller can reasonably be expected to recover.
A15-0-6An 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-8A 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-2If a function throws an exception, it shall be handled when meaningful actions can be taken, otherwise it shall be propagated.
A17-0-2All 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-6An 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

Related Topics