[previous] 0781 [next] '%s' is being used as a structure/union member as well as being a label, tag or ordinary identifier.
Identifiers REFERENCE - ISO:C90-6.1.2.3 Name Spaces of Identifiers

The same identifier can refer to more than one entity providing the entities are declared in different scopes or different namespaces.

Messages 0781 and 0783 are generated when the same identifier is declared both as a struct/union member and also as a label, tag or ordinary identifier. Message 0783 is generated on the first declaration and message 0781 on the second.

Notice that different messages (0780 and 0782) are generated where the same identifier is only reused within the tag, label and ordinary identifier namespaces. Notice also that no messages are generated when the same identifier is used for members in different structs or unions.

For example:


/*PRQA S 553,750,1310,2017,2213,2216,3205,3210,3447 ++*/

extern int A;                               /* Message 0783 + 1577 */
struct a1 {int A; int a2;};                 /* Message 0781 + 1582 */

union b1 {int B; int b2;};                  /* Message 0783 + 1577 */
typedef int B;                              /* Message 0781 + 1582 */

typedef struct c1 {int C; int c2;} C;       /* Message 0783 + 1577 and 0781 + 1582 */

extern int D;                               /* Message 0782 + 1577 */
struct D {int d1; int d2;};                 /* Message 0780 + 1582 */

typedef struct E {int e1; int e2;} E;       /* Message 0782 + 1577 and 0780 + 1582 */


struct f1 {int F; int f2;};                 /*                     */
struct f3 {int F; int f4;};                 /*                     */


See also:

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