On C/C++ undefined behaviours (on the term "undefined behaviours")

bearophile bearophileHUGS at lycos.com
Thu Oct 7 12:17:10 PDT 2010


BCS:

> Some where in the spec, D defines depending on order of evaluation to be 
> invalid (placing any related bugs in your code, not the compiler, by fiat) 
> but declines to requiter the compiler to enforce it (because it can't in 
> many cases). Maybe some term for "invalid but un checked" should be used.

Walter has stated two or three times that this will probably change (and I agree with this decision), so order of evaluation will be enforced in D (as it is in Java/C#). This may reduce performance a bit in some situations, but make the semantics of D code more defined (this means it will be safer). Performance is important, but even more important is to have a language that always does what you ask it to do.

Bye,
bearophile


More information about the Digitalmars-d mailing list