![]() |
![]() |
3224 | ![]() |
||||
![]() | |||||||
| Declarations and Definitions | |||||||
An object or function which has previously been declared with internal linkage has been redeclared without the static storage class specifier. This is allowed by the C standard but is confusing. If an object or function really is meant to have internal linkage, it is helpful if all declarations explicitly include the keyword static. For example:
/*PRQA S 2017,3207,3219,3227 ++*/
static int x1 = 0;
static int x2 = 0;
static int foo1(int a);
static int foo2(int b);
extern int x1; /* Message 3224 */
int x2; /* Message 0625 - conflicting declaration - undefined */
extern int foo1(int a)
{ /* Message 3224 */
return (a+1);
}
int foo2(int b)
{ /* Message 3224 */
return (b+1);
}
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |