MISRAC++2008-0-1-4_a
In this section:
Synopsis
(Required) A project shall not contain non-volatile POD variables having only one use.
Enabled by default
Yes
Severity/Certainty
Low/Medium

Full description
A variable is only used once.
Coding standards
- CWE 563
Unused Variable
Code examples
The following code example fails the check and will give a warning:
int example(void) {
int x = 1;
return 0;
}
The following code example passes the check and will not give a warning about this issue:
int example(void) {
int x;
x = 20;
return x;
}