Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(9887)

Issue 4444046: [google] Handle NULL return values in setlocale calls (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years ago by Diego Novillo
Modified:
12 years, 6 months ago
Reviewers:
paolo.carlini
CC:
jingyu, libstdc++_gcc.gnu.org, gcc-patches_gcc.gnu.org
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -21 lines) Patch
M libstdc++-v3/ChangeLog.google-main View 1 chunk +9 lines, -0 lines 0 comments Download
M libstdc++-v3/config/locale/generic/c_locale.h View 1 chunk +1 line, -1 line 0 comments Download
M libstdc++-v3/config/locale/generic/c_locale.cc View 3 chunks +24 lines, -12 lines 0 comments Download
M libstdc++-v3/config/locale/generic/time_members.cc View 2 chunks +16 lines, -8 lines 0 comments Download

Messages

Total messages: 3
Diego Novillo
I'm committing this patch for Jing Yu on google/main. The patch handles NULL values returned ...
13 years ago (2011-04-16 20:21:10 UTC) #1
jingyu
Thanks Diego for committing this patch. Yes, I would like to submit the patch to ...
13 years ago (2011-04-17 01:18:01 UTC) #2
paolo.carlini_oracle.com
13 years ago (2011-04-17 12:25:01 UTC) #3
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.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b