Cannot compile C file using ImportC

Stefan Koch uplink.coder at googlemail.com
Tue Nov 9 22:19:37 UTC 2021


On Tuesday, 9 November 2021 at 21:03:20 UTC, Steven Schveighoffer 
wrote:
> On 11/9/21 3:05 PM, Stefan Koch wrote:
>
>> 
>> Yes it is valid C.
>> It is not valid D though.
>> 
>
> The file is named `tomld.c`
>
> The way importC works is, you pass a .c file to the compiler, 
> and it treats it as C.
>
> -Steve

It rather tries to interpret the C code as D code.
It's not a full C compiler rather it's a shim in front of the D 
frontend.
Therefore bugs like the above can happen if the compiler wasn't 
aware that the function identifier was to be interpreted in "C 
context"


More information about the Digitalmars-d-learn mailing list