[Suggestion] Command line option: List defined version identifiers

Gregor Richards Richards at codu.org
Thu Sep 14 18:59:25 PDT 2006


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



More information about the Digitalmars-d mailing list