This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: tmpnam and mkstemp

> Date: Tue, 23 Jan 2001 09:19:43 -0800
> From: habib <>
> To: "" <>

> I get this surprising diagnostic:

>      the use of `tmpnam' is dangerous, better use `mkstemp'

> when compiling code that uses the ANSI-C function tmpnam()
> with gcc 2.95.2 on redhat 7.  I did not use to get this diagnostic
> with egcs 1.1.2.

> Is anybody else experiencing this?

Yes, it is a feature.

> What might be causing it?

There is special code in the software to enable gcc to provide this
warning to you.

The compiler is trying to inform you that the use of tmpnam is
dangerous, and that if your maintaining the code, that you should fix
the code.  Please complain to the vendor of your software that you are
compiling, if you wish to see it fixed.  If you don't care, you can
just ignore it.  The code will behave just as it did with the egcs

For additional information, you might try a good UNIX C programming
book, or comp.lang.c, or one of the UNIX groups or the glibc list.
If you don't know what a comp.lang.c is, try under

Hope this helps.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]