![]() |
![]() |
2961 | ![]() |
||||
![]() | |||||||
| Unset data | |||||||
A definite anomaly has been detected. Examination of the context indicates that this object will always be uninitialized at this point and so its value will be undefined. This message will only be generated for automatic objects. Objects with static storage duration are initialized to zero by default. For example:
/*PRQA S 2017,2983,2986,3120,3199,3203,3321,3408 ++*/
void foo(void)
{
int i; /* 3196 */
int j;
j = i + 2; /* 2961 */
}
MISRA C:2012 Rules applicable to message 2961:
| Rule-9.1 (Mandatory) | The value of an object with automatic storage duration shall not be read before it has been set |
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |