dchar undefined behaviour

tsbockman via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 23 13:08:52 PDT 2015


On Friday, 23 October 2015 at 12:17:22 UTC, Walter Bright wrote:
> I think that ship has sailed. Illegal values in a dchar are not 
> UB. Making it UB would result in surprising behavior which 
> you've noted. Also, this segues into what to do about string, 
> wstring, and dstring with invalid sequences in them. Currently, 
> functions defined what they do with invalid sequences. Making 
> it UB would be a burden to programmers.

That makes sense to me. I think the language would have to work a 
lot harder to block the creation of invalid dchar values to 
justify the current VRP assumption.

Fixing the compiler in accordance with option #2 looks like it 
should be easy, so far.


More information about the Digitalmars-d mailing list