Bug 13989 – add system-specific ext to -of parameter if ext is invalid
Status
RESOLVED
Resolution
LATER
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-01-16T07:06:00Z
Last change time
2015-09-10T17:07:17Z
Assigned to
nobody
Creator
b2.temp
Comments
Comment #0 by b2.temp — 2015-01-16T07:06:41Z
consider the following cases:
1) dmd myfile.d -ofprogram
DMD produces the file "program.exe"
2) dmd myfile.d -ofprogram.exe
DMD produces the file "program.exe"
3) dmd myfile.d -ofprogram.cool
DMD produces the file "program.cool"
4) dmd myfile.d -ofprogram.cool.exe
DMD produces the file "program.cool.exe"
In the third case, DMD should produce the file "program.cool.exe"
Currently it seems that DMD looks for any extension and doesn't add one if a dot is found.
However a filename can include many dots, it's a legal syntax.
DMD should compare the extension found with the one expected (according to the other switches, such as -lib) and then add the expected one if they are different.
Comment #1 by blah38621 — 2015-01-16T07:22:12Z
I disagree with this, it is perfectly reasonable to want to output a file with a non-standard extension, many plugin mechanisms for instance use a file extension other than .dll. I believe it is the user's issue if they want to output a file with an extension of .cool.
Comment #2 by b2.temp — 2015-01-16T09:50:25Z
Your argument doesn't stand. If I follow your logic then in case 2) the extension shouldn't be added.
Another thing: let's imagine a cross-plateform script for building an application, if the of parameter contain a dot in its name. On linux the output file can be executed directly but not under Win.
Maybe should I rephrase my feature request as a proposition for a new switch, e.g: "-fe" "force standard extension" ?
-fe: under win always add .exe, under nux add nothing
-lib -fe: always add .lib or .a
-shared -fe: always add .dll or .so
etc
Comment #3 by b2.temp — 2015-09-10T17:07:17Z
implementation of the -fe switch tested in ddmd. Maybe later when real D string will be used.