From: Bruno Haible <bruno@clisp.org>
To: Alejandro Colomar <alx@kernel.org>
Cc: liba2i@lists.linux.dev, sc22wg14@open-std.org,
libbsd@lists.freedesktop.org, tech-misc@netbsd.org,
christos <christos@netbsd.org>,
"Đoàn Trần Công Danh" <congdanhqx@gmail.com>,
"Paul Eggert" <eggert@cs.ucla.edu>,
"Eli Schwartz" <eschwartz93@gmail.com>,
"Guillem Jover" <guillem@hadrons.org>,
"Iker Pedrosa" <ipedrosa@redhat.com>,
"Michael Vetter" <jubalh@iodoru.org>,
"Robert Elz" <kre@netbsd.org>,
riastradh@netbsd.org, "Sam James" <sam@gentoo.org>,
"Serge E. Hallyn" <serge@hallyn.com>
Subject: Re: alx-0008 - Standardize strtoi(3) and strtou(3) from NetBSD
Date: Thu, 20 Mar 2025 13:44:49 +0100 [thread overview]
Message-ID: <20998621.Yz81rIOvuz@nimes> (raw)
In-Reply-To: <x34jdlyb6gf6asojjhzwpol5schyz4llk2ebrtzpb7ryje52u6@smbvzpoqcf6v>
Alejandro Colomar wrote:
> > At the same time, disallowing a leading '-' sign
> > is a benefit as well. I consider it a misfeature that strtoul() parses
> > "-3" successfully and returns ULONG_MAX-2, which was most certainly
> > not intended by the user.
>
> Agree; it is a misfeature. ...
>
> I wonder if there's any legitimate user of that misfeature.
I don't think there is. Callers who wish to accept a leading '-' sign
can call strtol() and cast the result to 'unsigned long'.
Bruno
next prev parent reply other threads:[~2025-03-20 12:45 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250318142555.09A86356820@www.open-std.org>
2025-03-18 13:54 ` alx-0008 - Standardize strtoi(3) and strtou(3) from NetBSD Alejandro Colomar
2025-03-18 21:16 ` Alejandro Colomar
2025-03-18 21:53 ` Bruno Haible
2025-03-18 22:43 ` Alejandro Colomar
2025-03-19 0:15 ` Bruno Haible
2025-03-19 15:26 ` Alejandro Colomar
2025-03-19 18:48 ` Alejandro Colomar
2025-03-19 18:56 ` Alejandro Colomar
2025-03-19 21:59 ` Bruno Haible
2025-03-19 23:12 ` Alejandro Colomar
2025-03-19 23:30 ` strtou(3) handling of negative input Alejandro Colomar
2025-03-19 23:52 ` alx-0008 - Standardize strtoi(3) and strtou(3) from NetBSD Thorsten Glaser
2025-03-20 0:19 ` Alejandro Colomar
2025-03-20 0:31 ` Thorsten Glaser
2025-03-20 0:36 ` Alejandro Colomar
2025-03-19 23:52 ` nullability of status parameter in strtoi/u(3) Alejandro Colomar
2025-03-20 12:44 ` Bruno Haible [this message]
2025-03-20 12:55 ` alx-0008 - Standardize strtoi(3) and strtou(3) from NetBSD Alejandro Colomar
2025-03-20 17:18 ` Thorsten Glaser
2025-03-20 14:26 ` Bruno Haible
2025-03-20 14:54 ` Alejandro Colomar
2025-03-19 19:27 ` Paul Eggert
2025-03-19 20:05 ` Alejandro Colomar
2025-03-19 20:39 ` Paul Eggert
2025-03-19 21:23 ` Alejandro Colomar
2025-03-20 0:39 ` Paul Eggert
2025-03-20 1:15 ` Alejandro Colomar
2025-03-20 7:03 ` Paul Eggert
2025-03-20 10:32 ` Alejandro Colomar
2025-03-19 15:56 ` Thorsten Glaser
2025-03-19 16:25 ` Alejandro Colomar
2025-03-19 16:36 ` Thorsten Glaser
2025-03-19 16:53 ` Alejandro Colomar
2025-03-19 17:35 ` Bruno Haible
2025-03-19 18:01 ` Alejandro Colomar
2025-03-20 16:13 ` alx-0008r2 " Alejandro Colomar
2025-03-18 17:20 ` [SC22WG14.29900] alx-0008 " Joseph Myers
2025-03-18 20:18 ` Alejandro Colomar
[not found] ` <20250318201854.66AB5356895@www.open-std.org>
2025-03-18 21:11 ` [SC22WG14.29912] " Joseph Myers
2025-03-18 21:35 ` Alejandro Colomar
2025-03-18 21:40 ` Alejandro Colomar
2025-03-18 22:14 ` Joseph Myers
2025-03-18 22:49 ` 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=20998621.Yz81rIOvuz@nimes \
--to=bruno@clisp.org \
--cc=alx@kernel.org \
--cc=christos@netbsd.org \
--cc=congdanhqx@gmail.com \
--cc=eggert@cs.ucla.edu \
--cc=eschwartz93@gmail.com \
--cc=guillem@hadrons.org \
--cc=ipedrosa@redhat.com \
--cc=jubalh@iodoru.org \
--cc=kre@netbsd.org \
--cc=liba2i@lists.linux.dev \
--cc=libbsd@lists.freedesktop.org \
--cc=riastradh@netbsd.org \
--cc=sam@gentoo.org \
--cc=sc22wg14@open-std.org \
--cc=serge@hallyn.com \
--cc=tech-misc@netbsd.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 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.