On Thursday, 20 August 2020 at 05:07:28 UTC, H. S. Teoh wrote:
On Thu, Aug 20, 2020 at 04:28:41AM +0000, Arun via Digitalmars-d-learn wrote:
Which version of DMD is GDC 10 based on?

Compile the following D program to find out:

-----
static assert(0, "Compiler language version: " ~ __VERSION__.stringof);
-----

I have this line in a file called langver.d, and whenever the exact language version isn't obvious, I compile it to find out the version. :-) (And yes it deliberately asserts instead of using pragma(msg) so that I don't have to type -o- or -of- or -c or whatever to suppress actual code emission, just `$compiler langver.d`.)


--T

Nice trick. Thanks. For the benefit of others, GDC 10 is based on DMD 2.076. https://dlang.org/changelog/2.076.0.html

Side note, Using $() is better than `` for subshells, as it makes nesting much easier. ;-)

Reply via email to