Comment #0 by timothee.cour2 — 2018-01-22T03:31:27Z
```
fun.cpp:extern"C" void test(){}
main.d:extern(C) void test(); void main(){}
```
clang++ -o fun.cpp.o -c fun.cpp
dmd fun.cpp.o main.d
(same bug with ldc2)
this caused https://github.com/Syniurge/Calypso/issues/59
proposed fix:
if `-of` explicitly passed on cmd line, fine, nothing to check
if not, infer output file as we already do, but first assert(!file.exists)
(regardless of what type of file it is, that's irrelevant)
downside:
dmd main2.d
#creates main2
dmd main2.d
#error main2 already exists, please specify -of=main2 explicitly to force write
I think the downside is not as bad as the bug I reported which deletes source code and can be very damaging if the file wasn't backed up in its latest form, which is common in edit/compile/debug cycles
Comment #1 by dfj1esp02 — 2018-01-23T07:41:42Z
What `clang++ fun.cpp.o` does?
Comment #2 by var.spool.mail700 — 2018-04-06T15:57:23Z
is this the same bug?
if i have 2 files with the same name, like this
test
test.d
and execute dmd -D test
dmd picks test.d and generates the test.html but deletes the test file.
Comment #3 by greensunny12 — 2018-04-06T16:02:00Z
(In reply to ArturG from comment #2)
> is this the same bug?
> if i have 2 files with the same name, like this
>
> test
> test.d
>
> and execute dmd -D test
>
> dmd picks test.d and generates the test.html but deletes the test file.
It's probably related, but it would be great if you could open a new issue for it, s.t. it can be properly tracked. Thanks!
Comment #4 by var.spool.mail700 — 2018-04-06T19:05:17Z