Thread overview
[Issue 22994] importC: some types not zero-initialized in static array
Apr 11, 2022
duser@neet.fi
Apr 15, 2022
Dlang Bot
Apr 17, 2022
Dlang Bot
April 11, 2022
https://issues.dlang.org/show_bug.cgi?id=22994

--- Comment #1 from duser@neet.fi ---
test with more cases:

char cs1[1];
double ds1[1];
char cs[2] = {0};
double ds[2] = {0.0};
struct { char cs[2]; } css = { {0} };
struct { double ds[2]; } dss = { {0} };
union { char cs[2]; } csu = { {0} };
union { double ds[2]; } dsu = { {0} };
int printf(char *, ...);
int main()
{
        printf("%d\n", (int)cs1[0]);
        printf("%lf\n", ds1[0]);
        printf("%d\n", (int)cs[1]);
        printf("%lf\n", ds[1]);
        printf("%d\n", (int)css.cs[1]);
        printf("%lf\n", dss.ds[1]);
        printf("%d\n", (int)csu.cs[1]);
        printf("%lf\n", dsu.ds[1]);
        printf("%d\n", (int)((char[2]){0})[1]);
        printf("%lf\n", ((double[2]){0})[1]);
        return 0;
}

enums aren't affected anymore, they seem to have been fixed for good

--
April 15, 2022
https://issues.dlang.org/show_bug.cgi?id=22994

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #13985 "fix Issue 22994 - importC: some types not zero-initialized in static …" fixing this issue:

- fix Issue 22994 - importC: some types not zero-initialized in static array

https://github.com/dlang/dmd/pull/13985

--
April 17, 2022
https://issues.dlang.org/show_bug.cgi?id=22994

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #13985 "fix Issue 22994 - importC: some types not zero-initialized in static …" was merged into master:

- 3ba8f6721954d1111ef8c8f4e740f890cc0c54fc by Walter Bright:
  fix Issue 22994 - importC: some types not zero-initialized in static array

https://github.com/dlang/dmd/pull/13985

--