tech-misc archive

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

Re: [SC22WG14.29912] alx-0008 - Standardize strtoi(3) and strtou(3) from NetBSD



On Tue, 18 Mar 2025, Alejandro Colomar wrote:

> Okay, let's try with some more rationale:
> 
> NetBSD has strtoi/u(3), but not wcstoi/u(3), AFAICS.  This is prior art.

Prior art is something to learn from, but if there are issues with it (and 
not being properly orthogonal when considered together with the existing 
APIs in the standard is such an issue) then they provide a basis for not 
adopting it exactly as-is.

> I don't feel qualified to propose a function for a family (wchar.h)
> which I have never used myself, nor implemented.
> 
> I think it would make sense to present two papers at the same time, one
> proposing the wchar.h variant, and one presenting the normal variant.  I
> just don't feel qualified to decide whether we want a wchar_t variant,
> nor to specify it myself.

This really doesn't need much expertise.  Just look at how strtol and 
wcstol differ (such as references to "wide character" for wcstol) and 
follow that.  I think that by the time the proposal reaches an actual 
document submitted to the committee, it should include both wide and 
narrow versions (even if earlier drafts just state that the wide version 
will be included in the full proposal, but omit it to reduce the extent to 
which changes need applying to both halves of the proposal, while it's 
still changing rapidly).

It's *excluding* the wchar_t version that would need more expertise to 
justify any such exclusion, because the default for these interfaces is to 
have both versions.

-- 
Joseph S. Myers
josmyers%redhat.com@localhost



Home | Main Index | Thread Index | Old Index