Surprise using DMD as replacement C compiler
Carl Sturtivant
sturtivant at gmail.com
Thu Feb 29 20:58:22 UTC 2024
On Thursday, 29 February 2024 at 20:40:34 UTC, Richard (Rikki)
Andrew Cattermole wrote:
> Looks like we don't have a dmd specific CC variable.
>
> https://github.com/dlang/dmd/blob/03f149760f53926d1c411d646f87894569fb1948/compiler/src/dmd/link.d#L480
>
> ```sh
> DMD_CC=$CC
> CC=dmd
> ```
I wanted CC=dmd in the build because it's now a C compiler, and
that's what I am using it for. And it's handy when replacing a
compiler for an existing C project.
I just didn't expect dmd to confuse itself with its paired C
compiler. Only a tiny change needed to fix this, as it happens on
exactly one occasion, when CC=dmd and then dmd should ignore CC.
That way there's no effect on the rest of the world.
The issue of whether to have a DMD_CC can then be regarded as a
separate matter.
I submitted a precise bug report.
https://issues.dlang.org/show_bug.cgi?id=24424
More information about the Digitalmars-d
mailing list