![]() |
![]() |
3451 | ![]() |
||||
![]() | |||||||
| Declarations and Definitions | |||||||
An object or function has been declared in more than one file within this translation unit. This should be avoided if at all possible because it becomes necessary to ensure that the declarations remain consistent, and this incurs a maintenance overhead. Ideally, an item with external linkage should be declared in a single header file which can be included in the translation units where the item is defined and referenced. In the following example, message 3451 is generated when the function printf() is declared in the main source file as well as in the standard header file "stdio.h".
/*PRQA S 553,2017,3447,3625 ++*/
#include <stdio.h>
extern int printf(const char *format, ...); /* Message 3451 */
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |