www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Different behavior of dmd and ldc2

reply Fyodor Ustinov <ufm ufm.su> writes:
Hi!

Simple test:
File "a.d" contained this:
---
module tst;

import std.stdio;

void main() {
     writeln("Hello world");
}
----

After compiling this file by "dmd a.d" I get executable with name 
"a".
After compiling by "ldc2 a.d" - executable with name "tst".

I do not know, who more right in this situation, but DMD is a 
"reference compiler" and his behavior "more correct", I think.

WBR,
     Fyodor.
Nov 05 2015
parent reply Kai Nacke <kai redstar.de> writes:
On Thursday, 5 November 2015 at 21:51:09 UTC, Fyodor Ustinov 
wrote:
 Hi!

 Simple test:
 File "a.d" contained this:
 ---
 module tst;

 import std.stdio;

 void main() {
     writeln("Hello world");
 }
 ----

 After compiling this file by "dmd a.d" I get executable with 
 name "a".
 After compiling by "ldc2 a.d" - executable with name "tst".

 I do not know, who more right in this situation, but DMD is a 
 "reference compiler" and his behavior "more correct", I think.

 WBR,
     Fyodor.
Hi Fyodor! ldc2 does not have the goal to be compatible in all aspects with dmd. So this behaviour is ok. But: ldmd2 is meant to be compatible with dmd. This tool has the same problem which is clearly a bug. Please create a bug report at https://github.com/ldc-developers/ldc/issues. Regards, Kai
Nov 07 2015
next sibling parent David Nadlinger via digitalmars-d-ldc <digitalmars-d-ldc puremagic.com> writes:
I'm wondering whether should fix this together with making -singleobj the
default for executable builds, and any other, similar issues.

- David

---
Sent from a mobile device.
On 7 Nov 2015 14:50, "Kai Nacke via digitalmars-d-ldc" <
digitalmars-d-ldc puremagic.com> wrote:

 On Thursday, 5 November 2015 at 21:51:09 UTC, Fyodor Ustinov wrote:

 Hi!

 Simple test:
 File "a.d" contained this:
 ---
 module tst;

 import std.stdio;

 void main() {
     writeln("Hello world");
 }
 ----

 After compiling this file by "dmd a.d" I get executable with name "a".
 After compiling by "ldc2 a.d" - executable with name "tst".

 I do not know, who more right in this situation, but DMD is a "reference
 compiler" and his behavior "more correct", I think.

 WBR,
     Fyodor.
Hi Fyodor! ldc2 does not have the goal to be compatible in all aspects with dmd. So this behaviour is ok. But: ldmd2 is meant to be compatible with dmd. This tool has the same problem which is clearly a bug. Please create a bug report at https://github.com/ldc-developers/ldc/issues. Regards, Kai
Nov 07 2015
prev sibling parent Fyodor Ustinov <ufm ufm.su> writes:
On Saturday, 7 November 2015 at 13:47:13 UTC, Kai Nacke wrote:

 ldc2 does not have the goal to be compatible in all aspects 
 with dmd. So this behaviour is ok. But: ldmd2 is meant to be 
 compatible with dmd. This tool has the same problem which is 
 clearly a bug. Please create a bug report at 
 https://github.com/ldc-developers/ldc/issues.
Done. WBR, Fyodor.
Nov 09 2015