[Suggestion] Command line option: List defined version identifiers
Stewart Gordon
smjg_1998 at yahoo.com
Thu Sep 14 17:08:21 PDT 2006
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.
More information about the Digitalmars-d
mailing list