An object with static storage duration lives for the entire program execution, including before application code begins. Its identifier’s visibility can be narrower than its lifetime. section 13.2.1 section 13.2
C objects can have static storage duration in several ways:
- File-scope objects that are not declared thread_local, and block-scope variables or compound literals declared static. section 13.2.1
- String literals, which always have static storage duration. section 13.2.1
Static-duration objects are always initialized. Initializers must be known at compile time or resolvable during process startup; objects without explicit initializers receive default initialization, such as zero for arithmetic types. section 13.2.1 section 13.4
double A = 37; 1
double* p = &(static double){ 1.0, };
int main(void) {
static double B;
}
The example combines a file-scope object, a pointer initialized with a static compound literal, and a block-scope static object. section 13.2.1

