flagging unsigned subtraction assigned to bigger signed number?

Guillaume Piolat first.nam_e at gmail.com
Tue May 20 16:35:22 UTC 2025


On Tuesday, 20 May 2025 at 15:20:10 UTC, Steven Schveighoffer 
wrote:
> On Tuesday, 20 May 2025 at 11:12:03 UTC, Guillaume Piolat wrote:
>> On Tuesday, 20 May 2025 at 03:11:47 UTC, Steven Schveighoffer 
>> wrote:
>>>
>>> Thoughts?
>>>
>>
>> Alt view: provide .ilength as a signed equivalent that would 
>> be here ptrdiff_t
>
> In this case, that wouldn't help. Because everything signed is 
> promoted to unsigned.
>
> -Steve

The only cure that doesn't break everything is getting rid of 
unsigned at every API level, the mindset "this is always >= 0 so 
should be unsigned" is what cause all those unsigned bugs.

But it's too late for .length


More information about the Digitalmars-d mailing list