@safe functions
Sean Eskapp
eatingstaples at gmail.com
Wed Jan 5 07:35:09 PST 2011
This is either a compiler bug, or outdated language documentation, but I'm
having some freedom with @safe functions:
* No casting from a pointer type to any type other than void*.
* No modification of pointer values.
* No taking the address of a local variable or function parameter.
I've attached code which does all three of these things, which compiles and runs.
Inline assembler was an error, as well as casting from integer to a pointer
type, but I didn't test anything else.
I'm using dmd2.exe as my compiler.
begin 644 main.d
M:6UP;W)T('-T9"YS=&1I;SL-"@T*0'-A9F4@=F]I9"!F;V\H:6YT('@I#0I[
M#0H):6YT(&$[#0H):6YT*B!Y(#T@)F$[("\O('1A:VEN9R!A9&1R97-S(&]F
M(&QO8V%L('9A<FEA8FQE#0H)8VAA<BH@>B`](&-A<W0H8VAA<BHI>3L at +R\@
M8V%S=&EN9R!P;VEN=&5R('1O(&YO;BUP;VEN=&5R('1Y<&4-"@DJ>B`](#0[
M("\O('=R:71I;F<@=7-I;F<@;6%L9F]R;65D('!O:6YT97(-"@D-"@EY(#T@
M)G@[("\O('1A:VEN9R!A9&1R97-S(&]F('!A<F%M971E<BP at 04Y$(&-H86YG
M:6YG('!O:6YT97(@=F%L=64-"@DJ>2`](#0[("\O(&-H86YG:6YG('9A;'5E
M#0H)#0H):6YT(&(@/2!C87-T*&EN="EY.R`O+R!C87-T:6YG(&9R;VT@<&]I
M;G1E<B!T>7!E('1O('1Y<&4@=&AA="!I<VXG="!V;VED*@T*?0T*#0IV;VED
G(&UA:6XH*0T*>PT*"6EN="!X(#T at -3`[#0H)9F]O*'@I.PT*?0T*
`
end
More information about the Digitalmars-d-bugs
mailing list