CS 3733 Operating Systems Notes: Storage and Linkage Classes


This material is from Chapter 2 of PUP.

Storage classes: static and automatic

The word static has two meanings is C.
One is related to storage class and the other to linkage class.

Linkage class determines whether variables can be accessed in files other than the one in which they are declared.


Object Where Declared static Modifies static
Applied?
Storage
Class
Linkage
Class
variableinside a function storage class yes static internal
variable inside a function storage class no automatic internal
variable outside any function linkage class yes static internal
variable outside any function linkage class no static external
function outside any function linkage class yes static internal
function outside any function linkage class no static external

Table 2.1 (page 31): Effect of using the static keyword modifier in a C program.