Consider: % cat x.c #include <u.h> uintptr foo; uintptr bar=&foo;
% 8c -c x.c # this works. % 5c -c x.c # this fails x.c:3 initializer is not a constant: bar If I change the last line to uintptr* bar=&foo; Both compilers compile it fine. But if I change the last line to uintptr bar=(uintptr)&foo; both compilers fail. Note that the last two examples are type correct. uintptr is the same size as int* so there should be no runtime cost and we already know from the second example that &foo is a link time constant. Similar code to the last two examples compiles on gcc/clang. This seems like a compiler bug.