Thread overview | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
September 15, 2006 [Suggestion] Command line option: List defined version identifiers | ||||
---|---|---|---|---|
| ||||
It would be useful to have a command line option that displays the version identifiers that are set. Maybe -versionlist or something. For example, for DMD on Win32:
C:\>dmd -versionlist
D_InlineAsm
D_InlineAsm_X86
DigitalMars
LittleEndian
X86
Windows
Win32
all
If nothing else is on the command line, it would just print this and then exit. If any other command line options are set, then the list will be adjusted accordingly. If the name of a D file has also been given, it would parse the file and output the full list of versions that are set for the module as a result of predefined versions, -version switches, other command line switches and version assignments in the code file.
Having it in DMD might encourage developers of other D compilers (particularly those that mimic DMD's CLUI, but potentially any) to implement such a facility; and then when this happens, it will become even more useful. It would provide an easy way to:
- determine the name by which a compiler vendor identifies itself
- determine which optional D features a given implementation supports
- check which version blocks will be tested - may be useful for testing the portability of code
- debug version manipulation within a module
Stewart.
--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y
------END GEEK CODE BLOCK------
My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
|
September 15, 2006 Re: [Suggestion] Command line option: List defined version identifiers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | On Thu, 14 Sep 2006 20:08:21 -0400, Stewart Gordon <smjg_1998@yahoo.com> wrote:
> It would be useful to have a command line option that displays the version identifiers that are set. Maybe -versionlist or something.
Sounds good to me.
|
September 15, 2006 Re: [Suggestion] Command line option: List defined version identifiers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | Stewart Gordon wrote:
> It would be useful to have a command line option that displays the version identifiers that are set. Maybe -versionlist or something. For example, for DMD on Win32:
>
> C:\>dmd -versionlist
> D_InlineAsm
> D_InlineAsm_X86
> DigitalMars
> LittleEndian
> X86
> Windows
> Win32
> all
>
> If nothing else is on the command line, it would just print this and then exit. If any other command line options are set, then the list will be adjusted accordingly. If the name of a D file has also been given, it would parse the file and output the full list of versions that are set for the module as a result of predefined versions, -version switches, other command line switches and version assignments in the code file.
>
> Having it in DMD might encourage developers of other D compilers (particularly those that mimic DMD's CLUI, but potentially any) to implement such a facility; and then when this happens, it will become even more useful. It would provide an easy way to:
>
> - determine the name by which a compiler vendor identifies itself
> - determine which optional D features a given implementation supports
> - check which version blocks will be tested - may be useful for testing the portability of code
> - debug version manipulation within a module
>
> Stewart.
>
Agreed.
- Gregor Richards
|
September 15, 2006 Re: [Suggestion] Command line option: List defined version identifiers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gregor Richards | Gregor Richards wrote:
> Stewart Gordon wrote:
>
>> It would be useful to have a command line option that displays the version identifiers that are set. Maybe -versionlist or something. For example, for DMD on Win32:
>>
>> C:\>dmd -versionlist
>> D_InlineAsm
>> D_InlineAsm_X86
>> DigitalMars
>> LittleEndian
>> X86
>> Windows
>> Win32
>> all
An excellent idea!
I wish the compiler version number would be included. And it should naturally also be one of the identifiers like any other.
|
September 15, 2006 Re: [Suggestion] Command line option: List defined version identifiers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | Stewart Gordon wrote:
> It would be useful to have a command line option that displays the version identifiers that are set. Maybe -versionlist or something. For example, for DMD on Win32:
>
> C:\>dmd -versionlist
> D_InlineAsm
> D_InlineAsm_X86
> DigitalMars
> LittleEndian
> X86
> Windows
> Win32
> all
Good idea, on Mac OS X 10.3 it would be:
$ gdmd -versionlist
GNU_BitsPerPointer32
GNU
BigEndian
PPC
Unix
darwin
all
--anders
|
September 15, 2006 Re: [Suggestion] Command line option: List defined version identifiers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Georg Wrede | Georg Wrede wrote: <snip> > I wish the compiler version number would be included. And it should naturally also be one of the identifiers like any other. I'm not entirely sure what you mean by this. If you want the compiler version number, for CC purposes or otherwise, use std.compiler. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
September 16, 2006 Re: [Suggestion] Command line option: List defined version identifiers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | Stewart Gordon wrote:
> Georg Wrede wrote:
> <snip>
>
>> I wish the compiler version number would be included. And it should naturally also be one of the identifiers like any other.
>
>
> I'm not entirely sure what you mean by this. If you want the compiler version number, for CC purposes or otherwise, use std.compiler.
>
> Stewart.
A compiler option that outputs these values will of course be used by external utilities, such as batch files, shell scripts, and other actors.
But std.compiler is foremost targeted at in-code use.
|
September 17, 2006 Re: [Suggestion] Command line option: List defined version identifiers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | Stewart Gordon wrote:
> I'm not entirely sure what you mean by this. If you want the compiler version number, for CC purposes or otherwise, use std.compiler.
I don't think std.compiler is being updated, though ?
DMD 0.166 says it is "0.0" and supports D spec 0.134
--anders
|
September 18, 2006 Re: [Suggestion] Command line option: List defined version identifiers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anders F Björklund | Anders F Björklund wrote: > Stewart Gordon wrote: > >> I'm not entirely sure what you mean by this. If you want the compiler version number, for CC purposes or otherwise, use std.compiler. > > I don't think std.compiler is being updated, though ? > DMD 0.166 says it is "0.0" and supports D spec 0.134 > > --anders That's a problem with the current std.compiler 'implementation'. It makes no sense to add features to the language or compiler to get around this. How would such features stay up to date if this can't, anyway? Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:-@ C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
Copyright © 1999-2021 by the D Language Foundation