MISRA C++:2008 Rule 8-5-1
All variables shall have a defined value before they are used
Description
Rule Definition
All variables shall have a defined value before they are used.
Rationale
The C++ standard does not specify what the value of an uninitialized memory is. 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:
Polyspace does not check if the constructor of a class initializes the nonstatic members of the class.
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 |