bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `


From: Chet Ramey
Subject: Re: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
Date: Tue, 28 Jul 2020 09:22:03 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 7/28/20 8:19 AM, Hongyi Zhao wrote:
> Hi,
> 
> On Ubuntu 20.04, I try to compile the git master version of bash with
> the followin steps:
> 
> $ sudo apt-get build-dep bash
> $ git clone https://git.savannah.gnu.org/git/bash.git bash.git
> $ cd bash.git
> $ ./configure
> $ make -j44
> [...]
> /usr/bin/ld: ./lib/sh/libsh.a(tmpfile.o): in function `sh_mktmpname':
> /home/werner/Public/repo/git.savannah.gnu.org/git/bash.git/lib/sh/tmpfile.c:152:
> warning: the use of `mktemp' is dangerous, better use `mkstemp' or
> `mkdtemp'
> [...]
> 
> 
> Any hints for fix this warning?

It's a spurious warning, with no apparent way to disable. The warning
assumes that you immediately want a file descriptor or a directory, but
provides no way to indicate that you are going to follow with mkfifo().
If you're going to do that, the warning is just wrong.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]