This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Roland McGrath wrote:
I see. However, do you mean the C standards or the C++ standard?I'm unsure about the following points: in case LC_ALL is not set is the fallback to LANG really needed (PR submitter implicitly expected this to be the case)? Also, if neither are set is always correct that "" -> "C"?The standards specify looking at LC_ALL, then at the variable for the particular category if setting just one, then at LANG.
This is an interesting technical point, thanks. However, once more, I'm not sure if the C++ standard (vs C) actually prescribes something in detail about this. Can you possibly help?Note that a variable that is present but empty (e.g. getenv("LC_ALL") => "") is treated as not present.
Off hand I am not sure if the behavior when none are set is specified or is implementation-defined. Defaulting to "C" is safe and consistent.
Good.
Another interesting technical point. As you say, however, it looks like the real point is: "Must we really match the detailed selection behavior of setlocale?" I don't believe that for the implementation of the locale functionality at issue this is mandated anywhere in the C++ standard.Another thing to note if you want to match the selection behavior of setlocale is that if the name contains a slash and the program is setuid then the name will be ignored and "C" used instead. (It doesn't check this on each variable, just on the name chosen from any.)
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |