flagging unsigned subtraction assigned to bigger signed number?
Derek Fawcus
dfawcus+dlang at employees.org
Wed May 21 19:24:18 UTC 2025
On Wednesday, 21 May 2025 at 19:19:37 UTC, Derek Fawcus wrote:
> 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)
Yup: https://home.nvg.org/~skars/programming/C_Rationale.pdf
(page 40 & 41)
"After much discussion, the Committee decided in favor of value
preserving rules, despite the fact that the UNIX C compilers had
evolved in the direction of unsigned preserving."
More information about the Digitalmars-d
mailing list