summaryrefslogtreecommitdiff
path: root/ext/POSIX/t
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2016-05-13 13:10:38 +0100
committerAaron Crane <arc@cpan.org>2016-05-16 13:47:10 +0100
commit1cb852db7b10e30cf24e4510b02cfa3361b07978 (patch)
tree18edb7a3218f8d530f408f841c34f66c0bddd0ac /ext/POSIX/t
parentb40d1aa27dae20c52bea2ec0d36f57aa37503988 (diff)
downloadperl-1cb852db7b10e30cf24e4510b02cfa3361b07978.tar.gz
POSIX: delete the L_tmpnam and L_tmpname symbols
The history here is relatively complicated. The L_tmpname symbol is neither specified by POSIX or defined by traditional Unix system; it's simply a typo for L_tmpnam, first introduced in Perl 5.0. Commit 33f01dd10fdacfa5ccb83c4f933cacb0f65b707e (part of Perl 5.6) added support for L_tmpnam, treating L_tmpname as a back-compat synonym. However, no version of Perl has ever made L_tmpnam exportable, even at explicit request; using that symbol has always required using its fully-qualified POSIX::L_tmpnam name. During the 5.8 development cycle, an apparently-unintended consequence of various improvements to the way that POSIX.pm generates and exports constants meant that L_tmpname stopped working. It continued to be exportable, but trying to use the constant yielded an exception saying "Your vendor has not defined POSIX macro L_tmpname". (This isn't exactly incorrect, of course: no vendor defines the macro L_tmpname!) At this point, therefore, there seems little benefit in trying to resurrect support for the L_tmpname typo: it's impossible for any program running on 5.8.0 or later to have successfully used it. There's perhaps an argument for making L_tmpnam exportable at this point, since it does work when called by its full-qualified name. One option would be to add it to @EXPORT_OK; but that is explicitly counselled against by the POSIX.pm comments summarising the policy on symbol exports, which recommend adding a new export tag instead. In this case, the obvious tag to use is :stdio_h (which already exists), since the C-level symbol is provided by the <stdio.h> header. However, that doesn't seem worth it to me. The only possible use of L_tmpnam is to create a buffer of a size suitable for passing to the tmpnam() C function (which is presumably why nobody's noticed in the last fifteen years that the symbol isn't actually exported). Furthermore, the POSIX.pm wrapper for tmpnam() itself was deleted by 19fc2965b60669d7bc25548edb32e3cdd86a68de, a few days ago, so merely deleting this additional symbol seems correct.
Diffstat (limited to 'ext/POSIX/t')
-rw-r--r--ext/POSIX/t/export.t4
-rw-r--r--ext/POSIX/t/unimplemented.t1
2 files changed, 3 insertions, 2 deletions
diff --git a/ext/POSIX/t/export.t b/ext/POSIX/t/export.t
index f82a5919fe..5f71b32bb7 100644
--- a/ext/POSIX/t/export.t
+++ b/ext/POSIX/t/export.t
@@ -49,7 +49,7 @@ my %expect = (
LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LDBL_DIG
LDBL_EPSILON LDBL_MANT_DIG LDBL_MAX LDBL_MAX_10_EXP
LDBL_MAX_EXP LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP LINK_MAX
- LONG_MAX LONG_MIN L_ctermid L_cuserid L_tmpname MAX_CANON
+ LONG_MAX LONG_MIN L_ctermid L_cuserid MAX_CANON
MAX_INPUT MB_CUR_MAX MB_LEN_MAX NAME_MAX NCCS NDEBUG
NGROUPS_MAX NOFLSH NULL OPEN_MAX OPOST O_ACCMODE O_APPEND
O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC
@@ -148,7 +148,7 @@ my %expect = (
localtime log mkdir nice open opendir pipe printf rand
read readdir rename rewinddir rmdir sin sleep sprintf sqrt
srand stat system time times umask unlink utime wait
- waitpid write
+ waitpid write L_tmpnam
),
# this stuff was added in 5.21
# (though an oversight meant that lround wasn't listed here
diff --git a/ext/POSIX/t/unimplemented.t b/ext/POSIX/t/unimplemented.t
index 9a03a75265..6ee85f683d 100644
--- a/ext/POSIX/t/unimplemented.t
+++ b/ext/POSIX/t/unimplemented.t
@@ -88,6 +88,7 @@ foreach ([atexit => 'C-specific: use END {} instead'],
[vfprintf => 'C-specific, stopped'],
[vprintf => 'C-specific, stopped'],
[vsprintf => 'C-specific, stopped'],
+ [L_tmpnam => 'C-specific, stopped'],
) {
my ($func, $action) = @$_;
my $expect = ref $action