Re: [PATCH v1] xstrtol: 1 is not a valid base

2024-07-19 Thread Bruno Haible
Alejandro Colomar wrote: > BTW, does gnulib have documentation for xstrtol()? I couldn't find it. > And for MALLOC()? I'm interested in reading both. Paul added the documentation for xstrtol(). There is no macro or symbol named MALLOC in gnulib; I don't know what you are referring to. Bruno

Re: [PATCH v1] xstrtol: 1 is not a valid base

2024-07-19 Thread Bruno Haible
Paul Eggert wrote: > I installed the attached Gnulib patch which addresses that > point ... The comments reference parameter names VAL, VALID_SUFFIXES, etc. but the declaration does not contain parameter names. This patch fixes that: 2024-07-19 Bruno Haible xstrtol: Improve document

Re: [PATCH v1] xstrtol: 1 is not a valid base

2024-07-19 Thread Alejandro Colomar
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

Re: [PATCH v1] xstrtol: 1 is not a valid base

2024-07-18 Thread Paul Eggert
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

Re: [PATCH v1] xstrtol: 1 is not a valid base

2024-07-18 Thread Alejandro Colomar
Hi Bruno, On Thu, Jul 18, 2024 at 08:06:07PM GMT, Bruno Haible wrote: > Alejandro Colomar wrote: > > If xstrtol() was being called with a base of 1, under some conditions it > > would invoke Undefined Behavior. > > Yes, sure. A numeric base of 1 makes no sense, mathematically. > > Thanks for the

Re: [PATCH v1] xstrtol: 1 is not a valid base

2024-07-18 Thread Bruno Haible
Alejandro Colomar wrote: > If xstrtol() was being called with a base of 1, under some conditions it > would invoke Undefined Behavior. Yes, sure. A numeric base of 1 makes no sense, mathematically. Thanks for the patch; applied. Note that I disagree with the statement from https://github.com/voi