gdc --version doesn't indicate which D front-end version it's compatible with

Siarhei Siamashka siarhei.siamashka at gmail.com
Sun Jan 30 19:06:00 UTC 2022


On Sunday, 30 January 2022 at 17:41:21 UTC, Salih Dincer wrote:
> On Friday, 28 January 2022 at 17:42:25 UTC, singingbush wrote:
>> 
>> It would be far more helpful if running `gdc --version` gave 
>> some indication of the version of D it's aligned to (which was 
>> 2.076 last time I checked).
>
> It might be a silly question: If the compiler includes old 
> version Dlang.  So how about compiling with new version of 
> Phobos source files. Will it compile take too long, huh?

Phobos source files are included in the GDC source tree. 
Compiling GDC (actually GCC with C, C++, Objective C, Fortran, D 
and a bunch of other bells and whistles) takes more than one hour 
on my computer.

```
$ gdc-12.0.1 --version
gdc-12.0.1 (Gentoo 12.0.1, commit 
d1182631ee73f3c7efeb5e70e6caa2da064df984) 12.0.1 20220130 
(experimental)
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  
There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE.
```

Just as the message says, it's an experimental build from git. 
Various bugs may be expected in both D frontend and GCC backend. 
But it's good enough as a preview of the new features.

I doubt that compiling the newest Phobos with the old GDC 11 is 
going to work smoothly. If this was the case, then newer Phobos 
would have been already bundled with GDC 11.

> One more question but it will be irrelevant: If we leave DMD 
> out of the question; other compilers throwing an error when 
> compiling with "-version=test1" etc. I guess only DMD supports 
> it?

It's "-fversion=test1" for GDC.


More information about the D.gnu mailing list