Thread overview | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
January 02 [Issue 24315] dmd/cpreprocess.d:87: warning: the use of `tmpnam' is dangerous, better use `mkstemp' | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24315 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ibuclaw@gdcproject.org -- |
January 02 [Issue 24315] dmd/cpreprocess.d:87: warning: the use of `tmpnam' is dangerous, better use `mkstemp' | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24315 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |regression --- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> --- This is a regression. github.com/dlang/dmd/pull/15981 -- |
January 03 [Issue 24315] dmd/cpreprocess.d:87: warning: the use of `tmpnam' is dangerous, better use `mkstemp' | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24315 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ImportC CC| |bugzilla@digitalmars.com -- |
January 03 [Issue 24315] dmd/cpreprocess.d:87: warning: the use of `tmpnam' is dangerous, better use `mkstemp' | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24315 --- Comment #2 from Walter Bright <bugzilla@digitalmars.com> --- The problem with using mkstemp() is it returns a file descriptor. I need it to return a file name. Any way the warning can be turned off? -- |
January 03 [Issue 24315] dmd/cpreprocess.d:87: warning: the use of `tmpnam' is dangerous, better use `mkstemp' | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24315 --- Comment #3 from Walter Bright <bugzilla@digitalmars.com> --- Maybe I just need to write our own tmpnam() function. -- |
January 03 [Issue 24315] dmd/cpreprocess.d:87: warning: the use of `tmpnam' is dangerous, better use `mkstemp' | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24315 kdevel <kdevel@vogtner.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kdevel@vogtner.de --- Comment #4 from kdevel <kdevel@vogtner.de> --- (In reply to Walter Bright from comment #2) > The problem with using mkstemp() is it returns a file descriptor. I need it > to return a file name. It returns the file name, too: [1] [2] [3] [4] [1] https://pubs.opengroup.org/onlinepubs/009604499/functions/mkstemp.html "The string in template should look like a filename with six trailing 'X' s; mkstemp() replaces each 'X' with a character from the portable filename character set." [2] https://forum.dlang.org/post/mailman.4798.1421530338.9932.digitalmars-d-learn@puremagic.com "Getting a safe path for a temporary file" [3] https://forum.dlang.org/post/mailman.667.1343269970.31962.digitalmars-d@puremagic.com "temporary files - what is the resolution?" [4] https://www.gnu.org/software/gnulib/manual/html_node/mkstemp.html -- |
January 06 [Issue 24315] dmd/cpreprocess.d:87: warning: the use of `tmpnam' is dangerous, better use `mkstemp' | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24315 --- Comment #5 from Walter Bright <bugzilla@digitalmars.com> --- It returns a file descriptor for an already opened file. -- |
January 06 [Issue 24315] dmd/cpreprocess.d:87: warning: the use of `tmpnam' is dangerous, better use `mkstemp' | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24315 --- Comment #6 from kdevel <kdevel@vogtner.de> --- (In reply to Walter Bright from comment #5) > It returns a file descriptor for an already opened file. The descriptor is unused and can be safely closed (or the FILE* ptr fclosed after using fdopen). Using mkstemp is how to create a named temporary file lege artis in GNU/Linux [5]. The actual filename is in the writable template-buffer given as parameter to mkstemp. The preprocessor will put its output into that file. I was under the impression that not the POSIX but the Windows version could pose problems here? [5] sec 2.2.2. (p. 7) of Ulrich Drepper: Defensive Programming for Red Hat Enterprise Linux (and What To Do If Something Goes Wrong) http://people.redhat.com/drepper/defprogramming.pdf -- |
January 06 [Issue 24315] dmd/cpreprocess.d:87: warning: the use of `tmpnam' is dangerous, better use `mkstemp' | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24315 --- Comment #7 from Iain Buclaw <ibuclaw@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. -- |
February 01 [Issue 24315] dmd/cpreprocess.d:87: warning: use of tmpnam is dangerous use mkstemp | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24315 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|dmd/cpreprocess.d:87: |dmd/cpreprocess.d:87: |warning: the use of |warning: use of tmpnam is |`tmpnam' is dangerous, |dangerous use mkstemp |better use `mkstemp' | -- |
Copyright © 1999-2021 by the D Language Foundation