Cannot compile C file using ImportC

rempas rempas at tutanota.com
Wed Nov 10 06:38:58 UTC 2021


On Tuesday, 9 November 2021 at 22:19:37 UTC, Stefan Koch wrote:
>
> 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"

I also think that Stefan is right here. If we check the spec page 
for [ImportC](https://dlang.org/spec/importc.html), in the 2nd 
note, first sentence, it says: "ImportC is a C compiler embedded 
into the D implementation". To me that seems that it is a full C 
compiler that treats the syntax as C and creates files that can 
be linked with D.


More information about the Digitalmars-d-learn mailing list