[previous] 0622 [next] [C] The identifier '%s' has been declared both with and without linkage in the same scope.
Constraint violations REFERENCE - ISO:C90-6.5 Declarations - Constraints

This is a constraint error

This identifier has been declared both with and without linkage in the same scope. Notice that the identifier declared without linkage is not necessarily an object; it may be any identifier in the ordinary identifier name space e.g a typedef or an enum constant.

For example:


/*PRQA S 2211,3205,3207,3211,3222,3223,3334,3408,3447 ++*/


typedef int f1;               /*              - f1 declared with no linkage       */
extern int f1;                /* Message 0622 - f1 declared with external linkage */

typedef int f2;               /*              - f1 declared with no linkage       */
static int f2;                /* Message 0622 - f1 declared with internal linkage */

extern int f3;                /*              - f1 declared with external linkage */
typedef int f3;               /* Message 0622 - f1 declared with no linkage       */

static int f4;                /*              - f1 declared with internal linkage */
typedef int f4;               /* Message 0622 - f1 declared with no linkage       */

void func(void)
{
   extern int a;              /*              - a  declared with external linkage */
   int        a;              /* Message 0622 - a  declared with no linkage       */

   extern int b;              /*              - b  declared with external linkage */
   static int b;              /* Message 0622 - b  declared with no linkage       */

   int        c;              /*              - c  declared with no linkage       */
   extern int c;              /* Message 0622 - c  declared with external linkage */

   static int d;              /*              - d  declared with no linkage       */
   extern int d;              /* Message 0622 - d  declared with external linkage */

}

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents