[Issue 22918] importC: some types not zero-initialized in static variables

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 24 19:06:55 UTC 2022


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

--- Comment #1 from duser at neet.fi ---
arrays initialized with the {0} syntax are also affected by this - C11 says the
remaining elements should be initialized the same as "objects that have static
storage duration"

int printf(char *, ...);
int main()
{ 
        char ca[2] = {0};
        printf("%d %d\n", (int)ca[0], (int)ca[1]);

        return 0;
}

should print 0, 0, prints 0, 255

--


More information about the Digitalmars-d-bugs mailing list