HP C A.06.05 Reference Manual
Program Organization
Declarations
Chapter 222
NOTE The separate name spaces for goto labels and for each struct, union, or enum
definition are part of the ANSI/ISO standard, but not part of the K&R language
definition.
The following example uses the same name, overuse, in four different ways:
int main(void)
{
int overuse; /* normal identifier */
struct overuse { /* tag name */
float overuse; /* member name */
char *p;
} x;
goto overuse;
overuse: overuse = 3; /* label name */
}
Structure, Union, and Enum Names
Each struct, union, or enum defines its own name space, so that different declarations can
have the same member names without conflict. The following is legal:
struct A {
int x;
float y;
};
struct B {
int x;
float y;
};
The members in struct A are distinct from the members in struct B.
Goto Labels Names that mark the target of a goto statement.
Function, Variable
and All Other
Names
Any name that is not a member of the preceding three classes.
Table 2-2 Name Spaces (Continued)
Name Spaces Description