MISRAC++2008-3-2-3_a
In this section:
Synopsis
(Required) A type, object or function that is used in multiple translation units shall be declared in one and only one file.
Enabled by default
Yes
Severity/Certainty
Low/Medium

Full description
Multiple declarations of the same external object or function were found. This check is identical to MISRAC2012-Rule-8.5_a, MISRAC2004-8.8_a.
Coding standards
- MISRA C:2004 8.8
(Required) An external object or function shall be declared in one and only one file.
- MISRA C:2012 Rule-8.5
(Required) An external object or function shall be declared once in one and only one file
Code examples
The following code example fails the check and will give a warning:
extern int x; extern int x; int x = 1;
The following code example passes the check and will not give a warning about this issue:
extern int x; int x = 1;