unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Rich Felker <dalias@libc.org>, Eric Blake <eblake@redhat.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	glibc list <libc-alpha@sourceware.org>,
	"libguestfs@redhat.com" <libguestfs@redhat.com>
Subject: Re: RFC: *scanf vs. overflow
Date: Fri, 22 May 2020 20:06:34 -0700	[thread overview]
Message-ID: <f96bf232-878f-6981-5214-988d0b65ae14@cs.ucla.edu> (raw)
In-Reply-To: <20200523011614.GE1079@brightrain.aerifal.cx>

On 5/22/20 6:16 PM, Rich Felker wrote:
> A new feature
> will not reliably be usable for decades in portable software, but new
> documentation of existing universal practice would be immediately
> usable.

We could do both.

Also, we could change glibc's behavior in a simpler way, by not adding a new
flag; but if an integer is out of range, then scan only the initial prefix that
fits, leaving the trailing digits for the rest of the format to scan. This also
conforms to POSIX and is more likely to cause C programs to do the right thing
(i.e., report a failure) than the current behavior does. And with luck perhaps
we could eventually get POSIX to standardize this behavior.

  reply	other threads:[~2020-05-23  3:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 20:59 RFC: *scanf vs. overflow Eric Blake via Libc-alpha
2020-05-23  1:16 ` Rich Felker
2020-05-23  3:06   ` Paul Eggert [this message]
2020-05-23 16:11     ` Rich Felker
2020-05-23 16:28       ` Paul Eggert
2020-05-23 16:45         ` Rich Felker
2020-05-23 17:18           ` Paul Eggert
2020-05-26  9:30           ` [Libguestfs] " Richard W.M. Jones via Libc-alpha
2020-05-23  7:06 ` Richard W.M. Jones via Libc-alpha
2020-05-23 15:25   ` Paul Eggert
2020-05-23 16:21   ` Rich Felker

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f96bf232-878f-6981-5214-988d0b65ae14@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=dalias@libc.org \
    --cc=eblake@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=libguestfs@redhat.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 read-only IMAP folder(s) and NNTP newsgroup(s).