[Issue 24315] dmd/cpreprocess.d:87: warning: the use of `tmpnam' is dangerous, better use `mkstemp'

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 6 22:27:56 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24315

--- Comment #7 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Walter Bright from comment #5)
> It returns a file descriptor for an already opened file.
The passed string is an out parameter as well.

@kdevel one convenience of tmpnam is that you don't have to worry about where
the $TEMP directory is located for the vagary of supported platforms.

> Maybe I just need to write our own tmpnam() function.
The generic-ish implementation should be simple enough, could return a slice
too instead of a pointer.

--


More information about the Digitalmars-d-bugs mailing list