All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Alejandro Colomar <alx@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Palmer Dabbelt <palmer@rivosinc.com>,
	linux-api@vger.kernel.org, libc-alpha@sourceware.org,
	linux-man@vger.kernel.org
Subject: Re: termios constants should be unsigned
Date: Wed, 12 Jun 2024 07:55:14 -0700	[thread overview]
Message-ID: <87af5e8f-0dcb-44a0-94de-757cad7d5ded@cs.ucla.edu> (raw)
In-Reply-To: <a7kfppfptkzvqys6cblwjudlpoghsycjglw57hxe2ywvruzkbd@e6nqpnxgwfnq>

On 2024-06-12 05:16, Alejandro Colomar wrote:
> tcgets.c:53:24:
>   error: implicit conversion changes signedness: 'int' to 'tcflag_t' (aka
>   'unsigned int') [clang-diagnostic-sign-conversion,-warnings-as-errors]

This is a bug in Clang not glibc, and if you're worried about it I 
suggest sending a bug report to the Clang folks about the false positive.

Even GCC's -Wsign-conversion, which is at least smart enough to not warn 
about benign conversions like that, is too often so chatty that it's 
best avoided.

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.

  parent reply	other threads:[~2024-06-12 14:55 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 ` Paul Eggert [this message]
2024-06-12 16:28   ` termios constants should be unsigned 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
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=87af5e8f-0dcb-44a0-94de-757cad7d5ded@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=akpm@linux-foundation.org \
    --cc=alx@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.