Shouldn't casting an object to void* be considered @safe?

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Sun Dec 15 09:32:12 UTC 2019


BTW, note that the spec defines a @safe function as one that has 
been statically checked to exhibit no undefined behaviour.

Casting from an non-pointer type to a pointer seems a pretty good 
example of something that makes it impossible to statically 
confirm that no undefined behaviour is taking place.


More information about the Digitalmars-d mailing list