This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: named locale error checking
On Thu, Jun 28, 2001 at 04:35:11PM -0700, Benjamin Kosnik wrote:
>
> > The locales supplied are part of the "implementation". If they are
> > not complete, that seeems like the implementation's problem; what is
> > the user supposed to do about it? To me, if the implemention comes
> > with incomplete locales, then the implementation should tolerate
> > incomplete locales gracefully. That means the implementation should
> > provide reasonable defaults for values not supplied.
>
> This appears to be an area with considerable implementation leeway.
> Therefore, for --enable-clocale=gnu, I'll do the error checking for
> incomplete locales as explained previously and document expected behavior.
>
> For other locale models, more elaborate constructions are possible.
>
> To me, substituting 'default' values into a named locale defeats the
> purpose of named locales entirely.
It appears to me that the people who composed your locale definitions
assumed that anything they didn't specify would default to "C" locale
behavior. (That seems eminently reasonable to me.) What does a C
program do when presented such a locale? The principle of least
surprise suggests that C++ should do the same.
Nathan Myers
ncm at cantrip dot org