HP C/iX Reference Manual (31506-90011)
14 Chapter2
Lexical Elements
Identifiers
If the declaration of an identifier for a function has no storage-class specifier, its linkage is
determined exactly as if it were declared with the storage-class specifier extern. If the
declaration of an identifier for an object has file scope and no storage-class specifier, its
linkage is external.
The following identifiers have no linkage:
• An identifier declared to be anything other than an object or a function.
• An identifier declared to be a function parameter.
• A block scope identifier for an object declared without the storage-class specifier
extern.
For example:
extern int i; /* External linkage */
static float f; /* Internal linkage */
struct Q { int z; }; /* Q and z both have no linkage */
static int func() /* Internal linkage */
{
extern int temp; /* External linkage */
static char c; /* No linkage */
int j; /* No linkage */
extern float f; /* Internal linkage; refers to */
/* float f at file scope */
}
Two identifiers that have the same scope and share the same name space cannot be spelled
the same way. Two identifiers that are not in the same scope or same name space can have
the same spelling and will bind to two different physical objects. For example, a formal
parameter to a function may have the same name as a structure tag in the same function.
This is because the two identifiers are not in the same name space.
If one identifier is defined in a block and another is defined in a nested (subordinate) block,
both can have the same spelling. For example:
{
int i;
<-A
.
.
<-B
.
{
float i;
<-C
.
<-D
.
.
}
<-E
.
.
<-F
.
}
<-G
In the example above, the identifier i is bound to two physically different objects. One
object is an integer and the other is a floating-point number. Both objects, in this case, have