public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: libc-alpha@sourceware.org
Subject: Re: Bad interaction between signal constants and -Wsign-conversion
Date: Fri, 31 Mar 2023 17:31:44 +0200	[thread overview]
Message-ID: <20230331153144.GB2458@cventin.lip.ens-lyon.fr> (raw)
In-Reply-To: <9d23a09f-31d6-17ce-5bd1-37f7035d1371@gmail.com>

On 2023-03-30 16:09:12 +0200, Alejandro Colomar wrote:
> On 3/30/23 15:59, Vincent Lefevre wrote:
> > But concerning struct sigaction in particular, shouldn't this be fixed
> > in POSIX?
> 
> IMHO, POSIX, and in general, standards, should follow implementations
> rather than lead them.  I think changes should start as vendor
> extensions.

However, there could be a discussion concerning POSIX at the same time.

> For example, timespec::tv_nsec was mandated to be long by POSIX and
> C11, but glibc used 'long long' in some cases, because it was
> necessary.  I would say using 'unsigned int' here would be a nice GNU
> extension, and if it proves its value, POSIX could later pick it.
> 
> However, as Zack said, I'm not sure how we could check if any programs
> out there are using this member unreasonably.

But on the opposite, it is possible that some programs assume that
flags are positive and these programs have not been tested with a
negative flag. So they could already be buggy, and an unsigned int
could fix them.

BTW, some systems seem to have an unsigned sa_flags:

  https://github.com/github/git-msysgit/blob/master/compat/mingw.h
  https://www.google.com/search?q=%22unsigned+long+sa_flags%22
  https://www.google.com/search?q=%22unsigned+int+sa_flags%22

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

      reply	other threads:[~2023-03-31 15:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28  1:23 Zack Weinberg
2023-03-28  1:58 ` Paul Eggert
2023-03-28 14:03   ` Cyril Hrubis
2023-03-28 14:53     ` Florian Weimer
2023-03-28 15:04       ` Andreas Schwab
2023-03-28 18:50         ` Florian Weimer
2023-03-29  0:08 ` Alejandro Colomar
2023-03-30 13:45   ` Zack Weinberg
2023-03-30 13:59   ` Vincent Lefevre
2023-03-30 14:09     ` Alejandro Colomar
2023-03-31 15:31       ` Vincent Lefevre [this message]

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=20230331153144.GB2458@cventin.lip.ens-lyon.fr \
    --to=vincent@vinc17.net \
    --cc=libc-alpha@sourceware.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).