[TUHS] C history question: why is signed integer overflow UB?
Lars Brinkhoff
lars at nocrew.org
Sat Aug 16 16:01:40 AEST 2025
Warner Losh writes:
> I suspect that it was the absence of a signed right shift. In my
> Decsystem-20 OS class, one of the differences between the compiler on
> the VAX and the compiler on the '20 was that -1 >> 1 was -1 on the VAX
> and 2^35-1 on the '20.
The DEC-20 (aka PDP-10) does have a signed right shift instruction.
Apparently the compiler didn't use it.
More information about the TUHS
mailing list