UB in D

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 9 23:29:06 PDT 2016


On Sunday, 10 July 2016 at 02:29:15 UTC, Andrei Alexandrescu 
wrote:
> Yeah, we'd ideally like very little UB and no UB in safe code.

no at all. define it, and for other cases raise an error. for the 
example given, the code should not compile. at all. cast the 
thing to ubyte or face the error. and even then, compiler should 
insert runtime check for not shifting more than 31/63 bits, just 
like it does for bounds. at least it should do that in @safe code.


More information about the Digitalmars-d mailing list