www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - extern safety

This compiles to assembler with no  safe mangling.

extern(C) int maybeNotSafe()  safe;

with the compiler accepting it as safe when called like so:

int notCurrentlyMachineVerified()  safe { return maybeNotSafe(); }


Assuming we have this in another file:

extern(C) int maybeNotSafe()  safe { return 42; }

might the tool chain be modified to emit the unmangled name as 
before, to serve C clients, and a dlang mangling + "ABI suffix" 
alias to enable machine checkability for dlang clients?

The attribute permutations could get ugly unless the linkers have 
some sort of set capability but probably better to have an exact 
match requirement for the alias than to abandon machine 
checkability.
Apr 12