GNU GCC's f77

Toon Moene toon@moene.indiv.nluug.nl
Mon Nov 13 14:07:00 GMT 2000


Murakami Hiroshi wrote:

> For example below, on FreeBSD 4.1R, the linker points out that
> use of tempnam is not good.
> 
> % cat a.f
>       program main
>       end
> % f77 a.f
> /usr/lib/libg2c.so: warning: tempnam() possibly used unsafely;
> consider using mkstemp()

Yesterday I tried to come up with a patch to let libf2c use mkstemp
instead of tempnam if available.  Unfortunately, during testing of that
patch (which worked) I noticed that mkstemp doesn't create temporary
files in $TMPDIR which tempnam does.  Because this is an important
feature of allocating SCRATCH files in Fortran (as users can determine
on which filesystem they will appear) I hesitate to switch to mkstemp.

Do you know why the FreeBSD developers consider tempnam a problem ?

Is it a generic problem with tempnam's specification, or is the specific
implementation on FreeBSD problematic ?

Thanks for any insight you have to offer.

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://g95.sourceforge.net/ (under construction)


More information about the Gcc-bugs mailing list