Serialization and tmpnam

Hi, I see the serialization library uses "tmpnam" quite a lot. I don't know what the status of this function is on other operating system. But on GNU/Linux at least (and I suppose it is the same for any POSIX system), it is considered to be bad practice [1]. Such a bad practice that the linker ld is especially programed to complain whenever somebody uses this function. Moreover, I see that Borland and Microsoft compilers "have brain-dead tmpnam functions" [2] so a replacement was needed. So it may be a good idea to completely remove the function "tmpnam" from the Serialization library and use a saner replacement instead. This way, the library tests would compile without any complaint from the linker on Linux. Regards, Guillaume [1] As does the manpage say: "Never use this function". [2] Comment at the beginning of serialization/test/test_tools.hpp.

On Thu, 15 Jul 2004 10:41:10 +0200 Guillaume Melquiond <guillaume.melquiond@ens-lyon.fr> wrote:
[1] As does the manpage say: "Never use this function".
Depending on the version, you may even see a more helpful message in the manpage. BUGS Never use this function. Use mkstemp(3) instead.
participants (2)
-
Guillaume Melquiond
-
Jody Hagins