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]

Re: [google] Handle NULL return values in setlocale calls (issue4444046)


Hi,
Thanks Diego for committing this patch.

Yes, I would like to submit the patch to trunk. The reason is for this
patch is that setlocale() in bionicC always returns NULL (bionicC does
not support setlocale()), however libstdc++ does not handle the NULL
return value of setlocale(xxx,NULL) and thus causes segmentation
fault.
The patch makes sense and I'm ok with it if you add a short comment explaining the issue, which we never encountered before. Of course, longer term we (you ;) may want to add to the library a 4th locale model beyond the existing ones, some sort of dummy locale model meant for targets like bionicC, which essentially don't provide locales at all, if I understand correctly: without a working setlocale how can you switch from one named locale to another in portable C code?

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]