linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Zack Weinberg" <zack@owlfolio.org>
To: "Paul Eggert" <eggert@cs.ucla.edu>,
	"Alejandro Colomar" <alx@kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Palmer Dabbelt" <palmer@rivosinc.com>,
	linux-api@vger.kernel.org,
	"GNU libc development" <libc-alpha@sourceware.org>,
	'linux-man' <linux-man@vger.kernel.org>
Subject: Re: termios constants should be unsigned
Date: Thu, 13 Jun 2024 08:32:01 -0400	[thread overview]
Message-ID: <f6ee2bd3-c1b7-4769-a313-b62f42c450ca@app.fastmail.com> (raw)
In-Reply-To: <87af5e8f-0dcb-44a0-94de-757cad7d5ded@cs.ucla.edu>

On Wed, Jun 12, 2024, at 10:55 AM, Paul Eggert wrote:
> A lot of this stuff is pedanticism that dates back to the bad old days
> when the C standard allowed ones' complement and signed magnitude
> representations of signed integers. Although it can be amusing to
> worry about that possibility (I know I've done it) it's never been a
> practical worry, and even the motivation of pedanticism is going away
> now that C23 requires two's complement.

Unless C23 eliminated *all* the cases where an operation on unsigned
integers is well-defined but the same operation on signed integers is
undefined, and last I checked it had not, there is still a need for
caution around conversions that change signedness.

zw

  parent reply	other threads:[~2024-06-13 12:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12 12:16 termios constants should be unsigned Alejandro Colomar
2024-06-12 12:22 ` Greg KH
2024-06-12 13:16   ` [PATCH] uapi/asm/termbits: Use the U integer suffix for bit fields Alejandro Colomar
2024-06-12 13:35     ` Greg KH
2024-06-12 14:00       ` Alejandro Colomar
2024-06-12 14:21         ` Greg KH
2024-06-12 15:07           ` Alejandro Colomar
2024-06-12 14:55 ` termios constants should be unsigned Paul Eggert
2024-06-12 16:28   ` Alejandro Colomar
2024-06-12 17:47     ` enh
2024-06-12 18:55       ` Alejandro Colomar
2024-06-12 19:01       ` Alejandro Colomar
2024-06-12 21:54         ` enh
2024-06-12 22:22           ` Alejandro Colomar
2024-06-12 18:27     ` Paul Eggert
2024-06-13 12:32   ` Zack Weinberg [this message]
2024-06-13 21:12     ` Paul Eggert
2024-06-13 21:37       ` Alejandro Colomar

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=f6ee2bd3-c1b7-4769-a313-b62f42c450ca@app.fastmail.com \
    --to=zack@owlfolio.org \
    --cc=akpm@linux-foundation.org \
    --cc=alx@kernel.org \
    --cc=eggert@cs.ucla.edu \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=palmer@rivosinc.com \
    /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).