This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlapi/Perl_setlocale: Clarify
authorKarl Williamson <khw@cpan.org>
Mon, 12 Mar 2018 18:29:42 +0000 (12:29 -0600)
committerKarl Williamson <khw@cpan.org>
Mon, 12 Mar 2018 18:47:18 +0000 (12:47 -0600)
locale.c

index d907e37..cd50be9 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -2091,9 +2091,9 @@ compensates; regular C<setlocale> doesn't.
 
 Another reason it isn't completely a drop-in replacement is that it is
 declared to return S<C<const char *>>, whereas the system setlocale omits the
-C<const>.  (If it were being written today, plain setlocale would be declared
-const, since it is illegal to change the information it returns; doing so leads
-to segfaults.)
+C<const> (presumably because its API was specified long ago, and can't be
+updated; it is illegal to change the information C<setlocale> returns; doing
+so leads to segfaults.)
 
 Finally, C<Perl_setlocale> works under all circumstances, whereas plain
 C<setlocale> can be completely ineffective on some platforms under some