Bug 768 – A switch to print predefined version identifiers

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2006-12-29T16:07:00Z
Last change time
2017-01-16T23:25:37Z
Keywords
bootcamp
Assigned to
alexandru.razvan.c
Creator
larsivar

Comments

Comment #0 by larsivar — 2006-12-29T16:07:49Z
Tools working with D code, and build tools in particular, need to know which version identifiers are set by the compiler. To make this exact and less error prone (a tool can't check which identifiers are set without knowing their names), a standard switch should be added to all D compilers (I have picked DMD here as this would presumably be a frontend feature.) The switch ( -versionids or similar) should print the set identifiers to stdout in an easily parseable format. The set printed by the compiler may change depending on environment or additional switches, for instance would GDC presumably print varying identifiers if cross compiling targets are specified.
Comment #1 by thomas-dloop — 2006-12-29T18:20:10Z
While the commandline switch is useful, a more integrated solution would be much more powerful: const char[][] all_defined_versions = version[]; That way debugging complex version setups becomes very easy.
Comment #2 by larsivar — 2006-12-30T04:14:31Z
(In reply to comment #1) > While the commandline switch is useful, a more integrated solution would be > much more powerful: > > const char[][] all_defined_versions = version[]; > > That way debugging complex version setups becomes very easy. > I don't think this could easily be made to handle cross compilation?
Comment #3 by thomas-dloop — 2006-12-30T07:49:06Z
What would be the potential issues with cross compilation?
Comment #4 by larsivar — 2006-12-30T07:52:50Z
(In reply to comment #3) > What would be the potential issues with cross compilation? > I may misunderstand your suggestion, but how would I (runtime) go about finding which version ids will be set given a specific target architecture/platform?
Comment #5 by thomas-dloop — 2006-12-30T20:09:13Z
(In reply to comment #4) The version ids set for cross compilation could be printed via a compile time template. (Issues #772 , #774 and #775 are currently blocking this kind of template.)
Comment #6 by andrei — 2016-10-13T20:00:54Z
We could make this part of the verbose run.
Comment #7 by alexandru.razvan.c — 2016-12-02T18:48:37Z
Comment #8 by github-bugzilla — 2016-12-07T15:42:11Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/e0392f9a2307e1be147f6e855fe7320dac4f2115 Fix Issue 768 - A switch to print predefined version identifiers https://github.com/dlang/dmd/commit/269e57650c6ac4afb43f6c1ed6f2b67c1c66a86b Merge pull request #6294 from Darredevil/issue-768 Fix Issue 768 - A switch to print predefined version identifiers
Comment #9 by github-bugzilla — 2016-12-27T14:41:32Z
Commits pushed to scope at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/e0392f9a2307e1be147f6e855fe7320dac4f2115 Fix Issue 768 - A switch to print predefined version identifiers https://github.com/dlang/dmd/commit/269e57650c6ac4afb43f6c1ed6f2b67c1c66a86b Merge pull request #6294 from Darredevil/issue-768
Comment #10 by github-bugzilla — 2017-01-16T23:25:37Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/e0392f9a2307e1be147f6e855fe7320dac4f2115 Fix Issue 768 - A switch to print predefined version identifiers https://github.com/dlang/dmd/commit/269e57650c6ac4afb43f6c1ed6f2b67c1c66a86b Merge pull request #6294 from Darredevil/issue-768