tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: alx-0008 - Standardize strtoi(3) and strtou(3) from NetBSD



Hi Thorsten,

On Wed, Mar 19, 2025 at 05:36:32PM +0100, Thorsten Glaser wrote:
> On Wed, 19 Mar 2025, Alejandro Colomar wrote:
> 
> >Please propose an implementation of the overload-selectinging macro
> 
> Well yes, no.

Could you please clarify?  I don't understand what you mean.  If you
think strtoi(3) should be replaced by a type-generic function, you
should clarify the semantics, at least to some degree (which I think
would be better with some code, but if you do with words it would be
better than nothing).

> >That macro can be implemented with C11.  Here's the implementation I
> 
> But not with C89.

A type-generic macro cannot be implemented in C89 at all.  C11 is the
minimum for anything type-generic (except for compiler magic).  You can
probably use the same compiler magic to backport my a2i() macro to
dialects older than C11.

> bye,
> //mirabilos
> PS: Please don’t Cc me explicitly on this thread.
> 
> >Ok.  Have a lovely day!
> 
> (That’s because I get it via a mailing list, to avoid duplicates,
> which is always a hassle to sort out in my INBOX.)

Cheers,
Alex

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

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index