2 ms·
Calling non-D functions means the compiler cannot check them, and will rely on the user having correctly specified and annotated the function signature. I.e. y
by WalterBright 7y ago
Calling non-D functions means the compiler cannot check them, and will rely on the user having correctly specified and annotated the function signature.
I.e. you can have "unsafe" annotated code which the compiler doesn't check, which is indeed where the dirty deeds get swept. For example, I doubt someone could write a guaranteed safe implementation of malloc().
The idea, naturally, is to specifically mark such sections so that your crack QA team knows what to focus on, and to minimize the amount of such code.
The trick is to make the safe sections expressive enough that it is practical to write the bulk of the code in safe sections, thereby minimizing the "threat surface".