betterC becoming unusable

rikki cattermole rikki at cattermole.co.nz
Mon Nov 7 09:50:47 UTC 2022


On 07/11/2022 4:59 PM, Steven Schveighoffer wrote:
> 2. Array comparison sometimes fails to link. That's right `string1 == 
> string2` may fail depending on whether the compiler decides that the 
> support template in druntime needs to be emitted to the object file. 
> This is unacceptable. If I have to use `strcmp` in betterC, I might as 
> well just use C.

Lets dig a bit.

https://github.com/dlang/dmd/blob/master/druntime/src/core/internal/array/comparison.d

It is templated (so it should already be emitting correctly).

https://github.com/dlang/dmd/blob/master/druntime/src/core/internal/string.d#L239

Also templated.

But why on earth is UTF-8 strings specially cased and not UTF-16 or UTF-32?

Thats not right...

No sanitization, its basically just byte for byte comparison. Which is 
the wrong way to compare Unicode strings anyway (and requires the tables)!


More information about the Digitalmars-d mailing list