Internal linkage restricts an identifier's designated entity to one translation unit. File-scope objects or functions that do not connect to other object files should use internal linkage, while identifiers shared across object files require external linkage. section 13.2
A file-local helper
static int square(int x) { return x * x; } int calculate(void) { return square(5); } The static declaration gives square internal linkage: code in another object file cannot use that identifier to refer to this function. The function remains available throughout the program's execution, so internal linkage is distinct from storage duration. section 13.2
Table 13.1 Storage classes, scope, linkage of identifiers, and storage duration of the associated objects. Tentative indicates that a definition is implied only if there is no other definition with an initializer. Induced indicates that the linkage is internal if another declaration with internal linkage has been met prior to that declaration; otherwise, it is external. Compound literals follow similar rules with respect to the block in which they occur, if any.
| Class | Scope | Definition | Linkage | Duration | Lifetime |
| Initialized | File | Yes | External | Static | Whole execution |
extern, initialized |
File | Yes | External | Static | Whole execution |
| String literal | Any | Yes | N/A | Static | Whole execution |
static, initialized |
Any | Yes | Internal | Static | Whole execution |
constexpr |
Any | Yes | Internal | Static | Whole execution |
| Uninitialized | File | Tentative | External | Static | Whole execution |
extern, uninitialized |
Any | No | Induced | Static | Whole execution |
static, uninitialized |
Any | Tentative | Internal | Static | Whole execution |
thread_local |
File | Yes | External | Thread | Whole thread |
extern thread_local |
Any | No | External | Thread | Whole thread |
static thread_local |
Any | Yes | internal | Thread | Whole thread |
| Non-VLA | None | ||||
Non-VLA, auto |
Block | Yes | None | Automatic | Block of definition |
register |
None | ||||
| VLA | Block | Yes | None | Automatic | From definition to |
| end of block | |||||
Function return |
Block | Yes | None | Automatic | To the end of |
| with array | expression |
Compare storage classes, scope, linkage, definitions, initialization, and storage duration in one reference table. section 13.2

