January 25, 2010 [dmd-internals] phobos fails with the new compiler | ||||
---|---|---|---|---|
| ||||
With the new beta, unittests in std.stdio fail. Apparently this is because the unittests run before static module initialization takes place. std.stdio relies on std.stdiobase to perform static initialization. The latter module defines static this() { std_stdio_static_this(); } and in turn that calls: extern(C) void std_stdio_static_this() { //printf("std_stdio_static_this()\n"); //Bind stdin, stdout, stderr __gshared File.Impl stdinImpl; stdinImpl.handle = core.stdc.stdio.stdin; .stdin.p = &stdinImpl; // stdout __gshared File.Impl stdoutImpl; stdoutImpl.handle = core.stdc.stdio.stdout; .stdout.p = &stdoutImpl; // stderr __gshared File.Impl stderrImpl; stderrImpl.handle = core.stdc.stdio.stderr; .stderr.p = &stderrImpl; } This function is not called (I uncommented the printf). The unittests are then invoked, and one of them checks whether std.stdio.stdin was initialized properly. Walter, did you change something in module initialization? Andrei |
January 25, 2010 [dmd-internals] phobos fails with the new compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | Is it ever called? I ran into a problem with the last release where some static initialization dependencies were lost.
On Jan 25, 2010, at 6:52 AM, Andrei Alexandrescu wrote:
> With the new beta, unittests in std.stdio fail. Apparently this is because the unittests run before static module initialization takes place.
>
> std.stdio relies on std.stdiobase to perform static initialization. The latter module defines
>
> static this()
> {
> std_stdio_static_this();
> }
>
> and in turn that calls:
>
> extern(C) void std_stdio_static_this()
> {
> //printf("std_stdio_static_this()\n");
>
> //Bind stdin, stdout, stderr
> __gshared File.Impl stdinImpl;
> stdinImpl.handle = core.stdc.stdio.stdin;
> .stdin.p = &stdinImpl;
> // stdout
> __gshared File.Impl stdoutImpl;
> stdoutImpl.handle = core.stdc.stdio.stdout;
> .stdout.p = &stdoutImpl;
> // stderr
> __gshared File.Impl stderrImpl;
> stderrImpl.handle = core.stdc.stdio.stderr;
> .stderr.p = &stderrImpl;
> }
>
> This function is not called (I uncommented the printf). The unittests are then invoked, and one of them checks whether std.stdio.stdin was initialized properly.
>
> Walter, did you change something in module initialization?
>
>
> Andrei
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals
|
Copyright © 1999-2021 by the D Language Foundation