flagging unsigned subtraction assigned to bigger signed number?

Derek Fawcus dfawcus+dlang at employees.org
Wed May 21 19:19:37 UTC 2025


On Wednesday, 21 May 2025 at 18:19:19 UTC, Walter Bright wrote:
>
> Back in 1989 when the first C standard was being developed, 
> half the existing compilers used "sign preserving" integral 
> conversions, while the other half used "value preserving". 
> Couldn't have both, one set of compilers was going to lose. But 
> never on the table was getting rid of mixed signed/unsigned 
> expressions. They were too valuable. (Value preserving was 
> selected.)

It has been a long time since I last used it, but I vaguely 
recall that
sign preserving was what K&R specified, and what the Bell Labs / 
AT&T compilers did.

Hence this was actually a change by the ANSI committee.

(Maybe the then existing value preserving compilers did so for a 
good reason)

DF


More information about the Digitalmars-d mailing list