Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: math and locale



> I'm mildly concerned that setting and restoring the locale is an excessive
> overhead, especially if it's a no-op (prev_local is already "POSIX" or "C").
> Can anyone reassure me?

I see that the setlocale code is a bit meatier than I would have expected.
On the other hand, a few string comparisons followed by setlocale is
potentially even worse for those using other than C/POSIX.

GNU libc seems to have an "extended locale model" allowing strtod to
take a locale argument; however, this is neither portable nor standardized.

I'm also beginning to wonder if prev_locale won't get clobbered somehow.

> I also wonder whether "C" would not be a better choice than "POSIX" here.

On sheer byte count or by some other criterion?



Messages sorted by: Reverse Date, Date, Thread, Author