ImportC and nothrow/@nogc?
Walter Bright
newshound2 at digitalmars.com
Tue Aug 27 22:04:42 UTC 2024
On 8/26/2024 11:12 AM, Timon Gehr wrote:
> 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.
People are very reluctant to modify their C files, as they usually come from
outside their organization. I've done a lot of work on ImportC to get it to work
with unmodified C code.
Note that Manu rejected my suggestion to use ImportC to generate .di files of
the function prototypes, and then edit in the attributes. This is equivalent to
your suggestion.
More information about the Digitalmars-d
mailing list