In C the memory address of a statically allocated object or a function is considered compile-time constant. For example this is valid code:
static int x;static int *const p = &x;static const char *const s = "The address of this string will not necessarily be the same across executions";But since there is no way all implementations can guarantee that the actual address of even statically allocated objects can be known at compile time, how can they be treated as compile-time constants and used in places where a constant expression is required such as an initializer for other statically allocated objects? But they are more similar to runtime constants. What techniques do compilers use to initialize statically allocated pointers to addresses of other statically allocated objects?