[Python-Dev] tempnam/tmpnam_r

Skip Montanaro skip@pobox.com (Skip Montanaro)
Fri, 17 Aug 2001 18:54:27 -0500


I get this from gcc:

    libpython2.2.a(posixmodule.o): In function `posix_tmpnam':
    /home/skip/src/python/head/dist/src/build/../Modules/posixmodule.c:4262: the use of `tmpnam_r' is dangerous, better use `mkstemp'
    libpython2.2.a(posixmodule.o): In function `posix_tempnam':
    /home/skip/src/python/head/dist/src/build/../Modules/posixmodule.c:4217: the use of `tempnam' is dangerous, better use `mkstemp'

I realize this has come up before.  Is it possible to preserve the semantics
of posix_tmpnam and posix_tempnam while switching the implementation over to
mkstemp where it's available?  Alternatively, perhaps Python should produce
a warning similar to what gcc produces the first time these functions are
called. 

Skip