The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Lars Brinkhoff <lars@nocrew.org>
To: Warner Losh <imp@bsdimp.com>
Cc: Luther Johnson <luther.johnson@makerlisp.com>, tuhs@tuhs.org
Subject: [TUHS] Re: C history question: why is signed integer overflow UB?
Date: Sat, 16 Aug 2025 06:01:40 +0000	[thread overview]
Message-ID: <7wjz33vm7v.fsf@junk.nocrew.org> (raw)
In-Reply-To: <CANCZdfomCJ5hz0iqeYsBC32Cq_u7gNmT-RR5mPU6DwPgZh4eyA@mail.gmail.com> (Warner Losh's message of "Fri, 15 Aug 2025 12:03:46 -0600")

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.

  reply	other threads:[~2025-08-16  6:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-15 17:17 [TUHS] C history question: why is signed integer overflow UB? Dan Cross
2025-08-15 17:31 ` [TUHS] " Luther Johnson
2025-08-15 17:36   ` Luther Johnson
2025-08-15 18:03     ` Warner Losh
2025-08-16  6:01       ` Lars Brinkhoff [this message]
2025-08-15 18:02   ` Nevin Liber
2025-08-15 18:25     ` Luther Johnson
2025-08-15 18:44       ` John Levine
2025-08-15 21:04         ` Douglas McIlroy
2025-08-15 21:59           ` Dave Horsfall
2025-08-15 23:58           ` Luther Johnson
2025-08-17  2:25 ` Clem Cole

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7wjz33vm7v.fsf@junk.nocrew.org \
    --to=lars@nocrew.org \
    --cc=imp@bsdimp.com \
    --cc=luther.johnson@makerlisp.com \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).