Talk: Storage Duration and Linkage in C and C++

A name declared in C or C++ may have attributes such as type, scope, storage duration, and linkage. These attributes often interact in subtle and sometimes confusing ways. Nowhere is this more evident than in the behavior of the keyword static. In some declarations, the presence or absence of static affects storage duration. In other declarations, it affects linkage.

In C++, it can also affect function types. The keyword extern has its share of quirks, too. These subtleties create further confusion about which program behaviors occur at compile time, at link time, and at run time. This talk clarifies the distinction between two of these attributes: storage duration and linkage. It offers insights that will help you program more effectively and take better control of the storage layout of your programs.