This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to libstc++: Remove strdup from locale_facets.tcc
>>> Approved for mainline. Concurrently, approved for 3.2.X branch since
>>> it is a regression from libstdc++-v2 as shipped with gcc 2.95.3.
>> And if you haven't checked it in before this email reaches you, please
>> change 'ANSI' to 'ISO' in your changelog entry.
> ... and if this is the right fix, then you may want to massage *all*
> the other strdup present in the library too:
> ./config/locale/generic/c_locale.cc:123:
> ./config/locale/generic/c_locale.cc:163:
> ./config/locale/generic/c_locale.cc:185:
> ./config/locale/generic/time_members.cc:54:
> ./config/locale/generic/time_members.cc:137:
> ./config/locale/gnu/messages_members.cc:52:
> ./config/locale/gnu/messages_members.cc:72:
> ./config/locale/gnu/monetary_members.cc:342:
> ./config/locale/gnu/monetary_members.cc:441:
> ./config/locale/gnu/time_members.cc:58:
> ./config/locale/gnu/time_members.cc:211:
> ./config/os/gnu-linux/ctype_noninline.h:50:
> ./config/os/gnu-linux/ctype_noninline.h:78:
> ./config/os/gnu-linux/ctype_noninline.h:108:
Well, Danny's patch affects a case where we expose strdup() in a
manner (a library header that may later be included by the user code)
that may be compiled with different switches than we can control
(i.e. we don't add -ansi to build the library).
The cases that you cite above all cover code compiled within the
library. Until we get a report that libstdc++-v3 doesn't itself
compile for a platform (and there is a good reason why we will never
get that report over this issue, I will explain via private e-mail
once you have thought about it ;-), I'd be inclined to follow this
portability-enhancement rule: "Ain't broke, don't fix."
Regards,
Loren