Name | Description | Notes | Source | Availability | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
extern |
Storage class for external objects | L | S | Keyword | C89 | C90 | C95 | C99 | C11 |
The keyword extern
is used in declarations of objects and
functions.
On a function, extern
emphasizes that the function has external linkage. However, it is usually
redundant, as this is the default anyway. One occasion when
it is not redundant is to provide a definition of an
in-line
function.
On an object declaration that doesn't include an
initializer, extern
ensures that the construct is purely a declaration, and not a
tentative definition, which is
essential if the object has incomplete type. On an object
declaration inside a block, it ensures that the declaration is for a
static object with external linkage.