MISRAC2004-8.9
In this section:
Synopsis
(Required) An identifier with external linkage shall have exactly one external definition.
Enabled by default
Yes
Severity/Certainty
Low/Medium

Full description
Multiple definitions or no definition were found for an external object or function. This check is identical to MISRAC2012-Rule-8.6, MISRAC++2008-3-2-4, MISRAC++2023-6.2.3_a.
This is a link analysis check.
Coding standards
- MISRA C:2012 Rule-8.6
(Required) An identifier with external linkage shall have exactly one external definition
- MISRA C++ 2008 3-2-4
(Required) An identifier with external linkage shall have exactly one definition.
- MISRA C++ 2023 6.2.3
(Required) The source code used to implement an entity shall appear only once
Code examples
The following code example fails the check and will give a warning:
void example(void) {}
The following code example passes the check and will not give a warning about this issue:
void example(void) {}