AUTOSAR C++14 Rule A8-5-0
All memory shall be initialized before it is read
Description
Rule Definition
All memory shall be initialized before it is read.
Rationale
The C++ standard does not specify what the value of an uninitialized memory can be. This value is unpredictable and can be different every time the program runs. Reading and using the value of an uninitialized memory results in unexpected behavior.
Polyspace Implementation
Polyspace® reports a violation of this rule if your code contains these issues:
Non-initialized variable: A variable is read before initialization.
Non-initialized member: A class member is not initialized in the class constructor:
Non-initialized pointer: A pointer is dereferenced before initialization.
Troubleshooting
If you expect a rule violation but Polyspace does not report it, see Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Declarators |
Category: Required, Automated |