This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add comment about tmpnam().
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 28 May 2014 18:11:12 +0000 (14:11 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 28 May 2014 18:12:49 +0000 (14:12 -0400)
ext/POSIX/POSIX.xs

index 4122db9..85c7fc3 100644 (file)
@@ -1424,6 +1424,12 @@ tmpnam()
     CODE:
        RETVAL = newSVpvn("", 0);
        SvGROW(RETVAL, L_tmpnam);
+       /* Yes, we know tmpnam() is bad.  So bad that some compilers
+        * and linkers warn against using it.  But it is here for
+        * completeness.  POSIX.pod warns against using it.
+        *
+        * Then again, maybe this should be removed at some point.
+        * No point in enabling dangerous interfaces. */
        len = strlen(tmpnam(SvPV(RETVAL, i)));
        SvCUR_set(RETVAL, len);
     OUTPUT: