[previous] 0780 [next] Another identifier '%s' is already in scope in a different namespace.
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 0780 and 0782 are generated when the same identifier is declared in different namespaces within the same scope. Message 0782 is generated on the first declaration and message 0780 on the second.

There are 2 exceptions to this rule relating specifically to members of structs and unions.
  1. No messages are generated when the same identifier is used for members in different structs or unions.
  2. Messages 0781 and 0783 are generated (instead of 0780 and 0782) when an identifier is used for a struct or union member but also for a label, tag or ordinary identifier.

For example:


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

extern int A;                               /* Message 0782 + 1577 */
struct A {int a1; int a2;};                 /* Message 0780 + 1582 */

typedef struct B {int b1; int b2;} B;       /* Message 0782 + 1577 and 0780 + 1582 */


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

union d1 {int D; int d2;};                  /* Message 0783 + 1577 */
typedef int D;                              /* Message 0781 + 1582 */

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

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



No MISRA C:2012 Rules applicable to message 0780


See also:

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