![]() |
![]() |
1509 | ![]() |
||||
![]() | |||||||
| CMA undefined | |||||||
More than one definition has been found of this object or function. If an identifier with external linkage is used but there does not exist exactly one external definition in the program for the identifier, behaviour is undefined. Notice that this is true whether the definitions are compatible or not.
In a linkable program, only one definition of a function or object is allowed. Example:
void foo(int)
{
}
void foo(int) // ERROR: foo is defined twice
{
}
Where the second definition occurs in a different translation unit,
the compiler will not be able to warn about the duplicate definition,
so a Cross Module or linker check is required to detect such
duplicates.
Example:
// TU1
void foo(int)
{
}
// TU2
void foo(int)
{
}
MISRA C:2012 Rules applicable to message 1509:
| Rule-1.3 (Required) | There shall be no occurrence of undefined or critical unspecified behaviour |
| Rule-8.6 (Required) | An identifier with external linkage shall have exactly one external definition |
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 |