Compiler Bug using D interface file for its intended purpose
Rambutan
s56l6zk0w at mozmail.com
Fri Sep 11 19:34:38 UTC 2026
On Friday, 11 September 2026 at 14:23:51 UTC, Richard (Rikki)
Andrew Cattermole wrote:
>> In summary, always compile and link in a D interface file. If
>> it is connected to a C project as a D replacement for C header
>> files, rename the .di file to a .d file and compile and link
>> that.
>>
>> ---curious if there's any disagreement with this, eager to
>> hear feedback.
>>
>> R.
>
> The file extension is irrelevant. The compiler treats them the
> same.
>
> The difference is -I/-extI vs being compiled in.
From my project,
```
$ gdc -c -o rt.o rt.di
$ ls -l rt.o
-rw-r--r-- 1 self self 928 Sep 11 14:31 rt.o
$ mv rt.di rt.d
$ gdc -c -o rt.o rt.d
$ ls -l rt.o
-rw-r--r-- 1 self self 67368 Sep 11 14:31 rt.o
$
```
More information about the D.gnu
mailing list