https://issues.dlang.org/show_bug.cgi?id=22923

          Issue ID: 22923
           Summary: importC: forward-declared static variable has invalid
                    address
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Keywords: ImportC, wrong-code
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

on linux with -fPIC:

static int xs;
int printf(char *, ...);
int main()
{
        printf("%p\n", &xs); // prints 0x1
        int x = xs; // segfaults
        return 0;
}
static int xs = 1;

seems to be the same as issue 22897 but for variables

--

Reply via email to