Table 1: Linkage for functions based on storage class specifier and scope
Storage Class Specifier | At Namespace Scope | Linkage for Functions at Class Scope | At Block Scope |
---|---|---|---|
name | same as extern | external linkage | same as extern |
auto | - | - | - |
extern | external linkage unless previously declared with internal linkage | - | external linkage unless previously declared with internal linkage in an enclosing scope |
register | - | - | - |
static | internal linkage | external linkage | - |
Note: An empty entry indicates an invalid combination of scope and storage class specifiers. |