From: Dave Horsfall <dave@horsfall.org>
To: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: [TUHS] Re: C history question: why is signed integer overflow UB?
Date: Sat, 16 Aug 2025 07:59:46 +1000 (EST) [thread overview]
Message-ID: <alpine.BSF.2.00.2508160754470.53898@aneurin.horsfall.org> (raw)
In-Reply-To: <CAKH6PiWDFm_js5zZ_0zHC0HpABSJ0u0dRsiW8=dO-JhrbWN2bA@mail.gmail.com>
On Fri, 15 Aug 2025, Douglas McIlroy wrote:
> Idle thought; There's been mention of 1's complement. If overflow is UB
> because of that possibility, maybe ==0 should be, too!
I understand that with ones-complement machines (such as the CDC series),
a computation resulting in -0 will be normalised to 0 (but a bit inversion
won't).
-- Dave
next prev parent reply other threads:[~2025-08-15 22:00 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
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 [this message]
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=alpine.BSF.2.00.2508160754470.53898@aneurin.horsfall.org \
--to=dave@horsfall.org \
--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).