On Thu, Jun 9, 2011 at 11:24 PM, Julien Nabet <[email protected]> wrote:
> Hello,
>
> 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 :
> "
> BUGS
>       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 ?

Functions are only dangerous if you don't use them properly ;)

tmpnam exists in the Windows CRT, but not mkstemp so this change will
break the build on Windows. An easy way to fix the build would be to
define mkstemp to be _mkstemp if the platform is Win32.

The best option probably (don't throw tomatoes at me!) would be to use
something similar to this for windows (maybe in sal?):

http://opengrok.libreoffice.org/xref/libs-core/svx/source/dialog/sendreportw32.cxx#202

-- 
Jesús Corrius <[email protected]>
Document Foundation founding member
Mobile: +34 661 11 38 26
Skype: jcorrius | Twitter: @jcorrius
_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to