Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fix issue 7995: D runtime initialization from C fails on OSX in 2.059, w... #205

Merged
merged 2 commits into from May 13, 2012

Conversation

jacob-carlborg
Copy link
Contributor

...orked in 2.058.

I also refactored the startup code to remove duplicated code.
This will hopefully reduce this kind of bugs in the future.

I had to remove the call to "runModuleUnitTests" in "rt_init". Meaning the unit tests won't be run if the runtime is just initialized via "rt_init". This basically only happens if you start the D runtime from a C application. The unit tests are still run, just as before, for all D applications with a D main function. Don't know if this is a problem or not.

jacob-carlborg and others added 2 commits May 5, 2012 22:54
…, worked in 2.058.

I also refactored the startup code to remove duplicated code.
This will hopefully reduce this kind of bugs in the future.
Conflicts:
	src/rt/dmain2.d
WalterBright added a commit that referenced this pull request May 13, 2012
Fix issue 7995: D runtime initialization from C fails on OSX in 2.059, w...
@WalterBright WalterBright merged commit 6467f87 into dlang:master May 13, 2012
WalterBright added a commit that referenced this pull request May 13, 2012
@WalterBright
Copy link
Member

Fails this test. Reverted.

// 2311

import std.stdio;

struct X()
{
static this()
{
printf("this()\n");
}
static ~this()
{
printf("~this()\n");
assert (false);
}
}

static ~this()
{
printf("g: ~this()\n");
}

int main() { alias X!() x; return 0; }

@jacob-carlborg
Copy link
Contributor Author

What is the expected behavior? I get the same result with my pull request as with the 2.059 release.

@jacob-carlborg
Copy link
Contributor Author

You're really not making it easy for me to figure out what went wrong. I need to know:

  • What exactly isn't working
  • On what platforms
  • What is the expected behavior

The above code snippet has the same behavior for me with my pull request applied as with the 2.059 release.

@WalterBright
Copy link
Member

The exit status of the program must be non-zero. It was zero. Sorry for not making that clear earlier. I tested it on OSX.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants