This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Mention sv_gets as the Perl-ish fgets-ish API.
[perl5.git] / t / porting / libperl.t
index 7bd2198..f62b80d 100644 (file)
@@ -468,10 +468,11 @@ for my $symbol (sort keys %expected) {
 }
 
 # There are certain symbols we expect NOT to see.
 }
 
 # There are certain symbols we expect NOT to see.
-
+#
 # gets is horribly unsafe.
 #
 # gets is horribly unsafe.
 #
-# fgets should not be used (Perl has its own API), even without perlio.
+# fgets should not be used (Perl has its own API, sv_gets),
+# even without perlio.
 #
 # tmpfile is unsafe.
 #
 #
 # tmpfile is unsafe.
 #
@@ -482,11 +483,21 @@ for my $symbol (sort keys %expected) {
 # (One exception: for certain floating point outputs
 # the native sprintf is still used in some platforms, see below.)
 #
 # (One exception: for certain floating point outputs
 # the native sprintf is still used in some platforms, see below.)
 #
-# XXX: add atoi() to %unexpected - unsafe and undefined failure modes.
+# atoi has unsafe and undefined failure modes, and is affected by locale.
+# Its cousins include atol and atoll.
+#
+# strtol and strtoul are affected by locale.
+# Cousins include strtoq.
+#
+# system should not be used, use pp_system or my_popen.
 #
 
 my %unexpected;
 
 #
 
 my %unexpected;
 
+for my $str (qw(system)) {
+    $unexpected{$str} = "d_$str";
+}
+
 for my $stdio (qw(gets fgets tmpfile sprintf vsprintf)) {
     $unexpected{$stdio} = undef; # No Configure symbol for these.
 }
 for my $stdio (qw(gets fgets tmpfile sprintf vsprintf)) {
     $unexpected{$stdio} = undef; # No Configure symbol for these.
 }
@@ -494,6 +505,13 @@ for my $str (qw(strcat strcpy strncat strncpy)) {
     $unexpected{$str} = undef; # No Configure symbol for these.
 }
 
     $unexpected{$str} = undef; # No Configure symbol for these.
 }
 
+$unexpected{atoi} = undef; # No Configure symbol for atoi.
+$unexpected{atol} = undef; # No Configure symbol for atol.
+
+for my $str (qw(atoll strtol strtoul strtoq)) {
+    $unexpected{$str} = "d_$str";
+}
+
 for my $symbol (sort keys %unexpected) {
     if (defined $unexpected{$symbol} && !$Config{$unexpected{$symbol}}) {
       SKIP: {
 for my $symbol (sort keys %unexpected) {
     if (defined $unexpected{$symbol} && !$Config{$unexpected{$symbol}}) {
       SKIP: {