Hi Paul,

On Thu, Jul 18, 2024 at 05:37:26PM GMT, Paul Eggert wrote:
> On 2024-07-18 12:53, Alejandro Colomar wrote:
> > I think it'd be common to assume that unless specifically
> > documented, you behave like POSIX's strtol(3), which produces defined
> > behavior for a base of 1.
> 
> Fair enough. I installed the attached Gnulib patch which addresses that
> point, along with the other points you raised about xstrtol that I
> understood.

Thanks!  I think the patch is good.  I think I would have split it in
several patches, since it does a bit too much, but that's your
prerogative.  ;)

I still think there's one issue in the function, which I reported in a
different thread, so I'll discuss it there.
<https://lists.gnu.org/archive/html/bug-gnulib/2024-07/msg00161.html>

> Since the system strtol can support base 1 as an extension,
> xstrtol now does whatever the system does so there's no need for the
> 'assume'.

Agree.

> (Not that any Gnulib-using programs care....) (Oh, and by the way,
> I don't think I put that 'assume'/'assert'/whatever code in there decades
> ago as I'm not a fan of that sort of thing....)

My git-blame(1) session pointed at

        commit 034a18049cbcc4b370052cb1fa28a81000a10849
        Author: Paul Eggert <egg...@cs.ucla.edu>
        Date:   Sat Dec 20 13:00:21 2014 -0800

            assure: new module

> PS. Sorry about missing a space in the ChangeLog entry - I fixed that in a
> followup patch.

No problem; typos happen.  Thanks!

Have a lovely day!
Alex


-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature

Reply via email to