public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Zack Weinberg via Libc-alpha <libc-alpha@sourceware.org>,
	 Carlos O'Donell <carlos@redhat.com>,
	 Zack Weinberg <zack@owlfolio.org>
Subject: Re: “Undefined behavior” considered harmful (was Re: Bug 29863 - Segmentation fault in memcmp-sse2.S…)
Date: Fri, 30 Dec 2022 14:28:07 +0100	[thread overview]
Message-ID: <87bknl3tso.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <87y1qp97j4.fsf@igel.home> (Andreas Schwab's message of "Thu, 29 Dec 2022 23:20:15 +0100")

* Andreas Schwab:

> On Dez 29 2022, Zack Weinberg via Libc-alpha wrote:
>
>> 1. The C standard uses “undefined behavior” far more liberally than it
>>    ought to.  In many cases of existing UB the committee could define
>>    the behavior (possibly as implementation-defined or unspecified)
>>    without any actual negative consequences.  It seems the committee
>>    *is* moving in this direction as of C2x, for instance by dropping
>>    the allowances for non-twos-complement signed arithmetic, but they
>>    could and should go a lot farther down that road.
>
> That's not removing an undefined behavior, it's removing an
> implementation choice.

Right, arithmetic is still not twos-complement, it's only about
representation.  Same with C++.

(I associate twos-complement signed *arithmetic* with the obvious
(unsigned) overflow behavior.)

  reply	other threads:[~2022-12-30 13:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13 18:20 Bug 29863 - Segmentation fault in memcmp-sse2.S if memory contents can concurrently change Narayanan Iyer
2022-12-13 18:31 ` Andrew Pinski
2022-12-13 18:39   ` Narayanan Iyer
2022-12-13 18:39 ` Cristian Rodríguez
2022-12-13 19:08 ` Noah Goldstein
2022-12-13 19:13   ` Narayanan Iyer
2022-12-13 19:25     ` Noah Goldstein
2022-12-13 20:56       ` Zack Weinberg
2022-12-13 23:29         ` Carlos O'Donell
2022-12-14  2:28           ` Zack Weinberg
2022-12-14  4:16             ` Carlos O'Donell
2022-12-14 14:16               ` Zack Weinberg
2022-12-14 17:36                 ` Paolo Bonzini
2022-12-29  7:09                   ` Zack Weinberg
2022-12-29 19:32               ` “Undefined behavior” considered harmful (was Re: Bug 29863 - Segmentation fault in memcmp-sse2.S…) Zack Weinberg
2022-12-29 22:20                 ` Andreas Schwab
2022-12-30 13:28                   ` Florian Weimer [this message]
2022-12-30 15:09                 ` Florian Weimer
2022-12-13 22:52       ` Bug 29863 - Segmentation fault vs invalid results, memory models, and control/data dependencies Carlos O'Donell
2022-12-14 12:03         ` Florian Weimer
2022-12-13 21:20   ` Bug 29863 - Segmentation fault in memcmp-sse2.S if memory contents can concurrently change Florian Weimer
2022-12-13 22:59     ` Noah Goldstein
2022-12-14 12:06       ` Florian Weimer

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=87bknl3tso.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@linux-m68k.org \
    --cc=zack@owlfolio.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 read-only IMAP folder(s) and NNTP newsgroup(s).