Comment #0 by default_357-line — 2009-12-16T07:10:47Z
Created attachment 524
Make address of member of global struct constant
When taking the address of a member of a global struct, as in
struct S { int x; }
S s;
const int* p = &s.x;
The above fails on 1.051 with "Error: non-constant expression &s.x"
The attached patch fixes this.
Comment #1 by default_357-line — 2009-12-23T21:31:08Z
Removing 'patch' keyword since the patch is known to be incorrect.
Comment #3 by pro.mathias.lang — 2019-08-10T18:33:37Z
I don't think we can even make them constant. Not in a way that could be used in CTFE anyway (because there could be a linker script, or just PIC / PIE).
So going to close this as WONTFIX.