MISRAC2012-Rule-2.8_a
In this section:
Synopsis
(Advisory) A project should not contain unused Object definitions.
Enabled by default
No
Severity/Certainty
Low/Medium

Full description
Unused external object definition.
This is a link analysis check.
Coding standards
- MISRA C:2012 Rule-2.8
(Advisory) A project should not contain unused Object definitions
Code examples
The following code example fails the check and will give a warning:
extern int unused_var; /* Non-compliant */
void example(void) {
}
The following code example passes the check and will not give a warning about this issue:
extern int used_var; /* Compliant */
int example(void) {
return used_var;
}