Ddoc $(SPEC_S The Memory Safe D Spec, $(P $(I Memory Safety) for a program is defined as it being impossible for the program to corrupt memory. Therefore, the Safe D consists only of programming language features that are guaranteed to never result in memory corruption. ) $(P Safe D is enabled on a per-module basis by compiling with the $(B -safe) compiler switch. )

Proscribed Forms

$(UL $(LI $(LINK2 iasm.html, Inline assembler). ) $(LI Casting away const or immutable attributes. ) $(LI Casting away shared attributes. ) $(LI Casting from one pointer type to another pointer type, except for: $(UL $(LI casting to $(CODE void*) is allowed) $(LI casting from a pointer to an arithmetic type to a pointer to another arithmetic type of the same or smaller size is allowed) ) ) $(LI Casting from a non-pointer type to a pointer type. ) ) $(P A safe module can import and use the public interface of a system module. )

Limitations

$(P Safe D does not imply that code is portable, uses only sound programming practices, is free of byte order dependencies, or other bugs. It is focussed only on eliminating memory corruption possibilities. ) ) Macros: TITLE=Memory-Safe-D-Spec WIKI=SafeDSpec