Is importC ready?

Dave P. dave287091 at gmail.com
Wed Nov 10 16:23:30 UTC 2021


On Wednesday, 10 November 2021 at 15:42:52 UTC, WebFreak001 wrote:
> On Tuesday, 9 November 2021 at 19:04:04 UTC, Dave P. wrote:
>> On Tuesday, 9 November 2021 at 18:45:04 UTC, bachmeier wrote:
>>> [...]
>>
>> ImportC understands `restrict`, it just doesn’t understand 
>> non-standard keywords. See 
>> [this](https://dlang.org/spec/importc.html#wrapping).
>>
>> That example is incomplete, but you can  `#define __restrict 
>> restrict`, `#define __asm__ asm`, etc.
>>
>> I agree that the error messages suck.
>
> https://dlang.org/spec/importc.html#restrict
>
>> The restrict type-qualifier (C11 6.7.3) is ignored

That is a conformant implementation of restrict. Restrict is just 
an optimization hint.

> The intended use of the restrict qualifier (like the register 
> storage class) is to promote optimization, and deleting all 
> instances of the qualifier from all preprocessing translation 
> units composing a conforming program does not change its 
> meaning (i.e., observable behavior).

By “understand” I mean it recognizes it as a keyword and that it 
is a type qualifier.


More information about the Digitalmars-d mailing list