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

Bug#377310: gcc: [inaccurate] warning: the use of `mktemp' is dangerous, better use `mkstemp'



Jari Aalto wrote:
> Package: gcc
> Version: 4:4.1.1-3
> Severity: normal
> 
> While compiling binutils-2.17 from (Debian) sources, gcc reports following:
> 
>     bucomm.o: In function `make_tempname':
>     /usr/src/net/deb/src/binutils-2.17/binutils/bucomm.c:426: warning: the use of `mktemp' is dangerous, better use `mkstemp'
> 
> 
> The proper fix is to use `mkdtemp' in the code, but the error message
> does not tell this.

FYI, in the case of binutils mkdtemp is not the proper fix, because
it has to be bootstrappable on machines without mkdtemp support.

In the general case it might be still no good idea, the manpage for
mkdtemp claims it is non-standard (glibc/OpenBSD only).


Thiemo



Reply to: