I have been searching for its correct answer for quite some time and here is what I found:-
The assumption that static data needs to be initialized by a constant expression everytime is not entirely accurate when it comes to C standards.
In C, static variables have static storage duration, which means they retain their value between function calls and are initialized only once. The initializer for a static variable must be a constant expression if the initialization happens at compile time. However, in the case of pointers, the address can be resolved at runtime.
The initialization of a static variable can indeed occur with the result of a runtime function, such as malloc, provided that it happens inside a function.
According to the C standard, static variables can be initialized with constant expressions or, in the case of pointers, with the result of a function call if the function call happens within a function.
However, some compilers enforce stricter rules and do not allow function calls in static initializers, as they expect static variables to be initialized at compile time, not runtime.
So, the answer is: (D) No error.