[Libreoffice] warning: the use of `tmpnam' is dangerous, better use `mkstemp'

Julien Nabet serval2412 at yahoo.fr
Thu Jun 9 14:24:16 PDT 2011


I had this warning by compiling hwpfilter during some cppcheck cleaning. 
I knew nothing about it so I read some links given by Google.
It seems mkstemp is safer since it permits "to avoid race conditions".

In the Unix man of tmpnam, we can read this :
        Never use this function.  Use mkstemp(3) or tmpfile(3) instead.

I'm just a beginner in C++ so what's your opinion about it ?


More information about the LibreOffice mailing list