Strspn should have an 'n'-variant similar to its string-handling siblings.
On Sat, Sep 21, 2013 at 05:19:17PM +0000, ooprala at redhat dot com wrote: > > Strspn should have an 'n'-variant similar to its string-handling siblings. > What are use cases where it is needed?
Why should more nonstandard functions with no precedent be added? At the very least, a usage case for where it's important to have such a function and have a highly optimized implementation in libc (as opposed to a trivial implementation in the application that needs it) should be provided before this is even considered.
Have to agree with Rich here, strspn is mandated by ISO C but I cannot find the n-variant in either ISO or POSIX. It will need a very good reason for being added, beyond programmers who can't write safe code without the crutch of so-called safe functions :-)
The existing strspn function isn't even such a great model for an API. In most cases, it would be beneficial to pre-compile the pattern. I don't think it makes sense to add more interfaces with the same issue.
On Fri, Jun 13, 2014 at 12:48:04PM +0000, fweimer at redhat dot com wrote: > https://sourceware.org/bugzilla/show_bug.cgi?id=15973 > > Florian Weimer <fweimer at redhat dot com> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |fweimer at redhat dot com > > --- Comment #5 from Florian Weimer <fweimer at redhat dot com> --- > The existing strspn function isn't even such a great model for an API. In most > cases, it would be beneficial to pre-compile the pattern. I don't think it > makes sense to add more interfaces with the same issue. > You could do caching on-line but it is not on my priority list.