Date: Sun, 5 Oct 1997 17:08:24 +0200 (IST) From: Eli Zaretskii To: Wolfgang DOT Glunz AT mchp DOT siemens DOT de cc: djgpp AT delorie DOT com Subject: Re: bug in tempnam ? In-Reply-To: <60u01c$dl9$1@salomon.mchp.siemens.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On 1 Oct 1997, Wolfgang Glunz wrote: > Together we found out that there might be a bug in the c-library > function tempnam (not tmpnam !). Under all other systems I known, > tempnam returns a pointer to newly allocated memory if the first > parameter is 0. Under djgpp 2.01 it looks like that tempnam behaves > the same as tmpnam which returns a pointer to a static memory which > is overwritten after each call to tmpnam. DJGPP's `tempnam' just calls `tmpnam' internally, so it indeed returns a pointer to a static buffer. However, AFAIK, `tempnam' is non-ANSI and non-POSIX, so no official standard exists for its behavior. Would you care to tell which ``other systems'' have `tempname' which returns a pointer to malloc'ed storage?