![]() |
![]() |
3210 | ![]() |
||||
![]() | |||||||
| Redundancy | |||||||
This object is being declared with external linkage in a source file in which it is never used. Is this really intended ? It shouldn't be necessary to declare objects or functions with external.linkage in a '.c' file. If the item is going to be used in more than one translation unit, it is better to have a single declaration located in a header file and then to include that header file in the appropriate translation units. This will avoid unnecessary duplication and improve maintainability. Message 3210 will not be generated for declarations in header files. For example:
/*PRQA S 2017,3408,3447 ++*/
extern int ga; /* Message 3210 - declaration */
int gb = 0; /* Message 3211 - definition */
int gc; /* Message 3211 - definition */
extern void foo(void)
{
return;
}
No MISRA C:2012 Rules applicable to message 3210
![]() | ||
| 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 |