www.digitalmars.com         C & C++   DMDScript  

D.gnu - Can gdc --version or -dumpversion output the corresponding DMD

reply mw <mingwu gmail.com> writes:
Hi,

Currently,

```
$ gdc-12 --version
gdc-12 (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0

$ gdc-12 -dumpversion
12
```

this is not very informative, as D (DMD) language is always 
changing, Can gdc --version or -dumpversion output the 
corresponding DMD front-end (language) version?

just as LDC does:

```
$ ldc2 --version
LDC - the LLVM D compiler (1.32.2):
   based on DMD v2.102.2 and LLVM 15.0.7

```
Jul 11 2023
parent Ernesto Castellotti <erny.castell gmail.com> writes:
On Tuesday, 11 July 2023 at 18:08:30 UTC, mw wrote:
 Hi,

 Currently,

 ```
 $ gdc-12 --version
 gdc-12 (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0

 $ gdc-12 -dumpversion
 12
 ```

 this is not very informative, as D (DMD) language is always 
 changing, Can gdc --version or -dumpversion output the 
 corresponding DMD front-end (language) version?

 just as LDC does:

 ```
 $ ldc2 --version
 LDC - the LLVM D compiler (1.32.2):
   based on DMD v2.102.2 and LLVM 15.0.7

 ```
I don't think it's possible because --version and -dumpversion are common throughout GCC. To get the version just compile a file with the content: pragma(msg, __VERSION__);
Jul 13 2023