ImportC and nothrow/@nogc?
Timon Gehr
timon.gehr at gmx.ch
Mon Aug 26 18:12:12 UTC 2024
On 8/26/24 07:37, Walter Bright wrote:
> On 8/24/2024 10:15 AM, Manu wrote:
>> *sigh* ... I'm not going to do that.
>> ImportC either works, or it doesn't... and it currently doesn't work,
>> and I'm just going to move on.
>> By far the easiest and least ridiculous feeling thing can do right now
>> is to just prototype the occasional C library call inline immediately
>> before the call, which is what I've moved on with.
>> Fortunately my call volume is low.
>
> You're right, that will work.
>
> I tried to make C calls default to @trusted. Every single person in the
> community who voiced an opinion on it was dead set against it. But here
> you are, saying who cares what C does.
>
> I've got a cannon on one side aimed at me, and a flak gun on the other
> side.
>
> What do you suggest I do?
>
Marking every C function `@trusted` would not solve his problem. What
would solve his problem is if ImportC supported C extensions that let
you mark groups of declarations using D attributes. Then you can put
those in the C files that you import.
More information about the Digitalmars-d
mailing list