I'm not sure why the error happened. However, in the following line the code is OK when compiling.
Does someone have any explanation?
#include <stdio.h>
int g_value = 10;
const int* p1 = &g_value;
const int* p2 = p1; // error: initializer element is not constant
int main()
{
const int* p3 = &g_value;
const int* p4 = p3; // Compile normally without any error!
return 0;
}