Subject: Re: Simple FORTRAN Program
To: Ray Phillips <r.phillips@mailbox.uq.edu.au>
From: David Brownlee <abs@netbsd.org>
List: port-i386
Date: 10/09/2001 10:40:08
tempnam() is used to generate a temporary filename. Unfortunately
it is subject to race conditions which could result in a program
using it being abused (see tempnam(3)).
My guess is the fortran compiler generates code that calls
tempnam for scratch files, resulting in the linkage warning.
(Its probably not smart enough to work out at compile time if
the fortran program actually uses scratch files).
If that is the case, g77 should probably be fixed, and may already
be in a later version :)
--
David/absolute -- www.netbsd.org: No hype required --
On Tue, 9 Oct 2001, Ray Phillips wrote:
> Dear NetBSD/i386:
>
> I'm no FORTRAN programmer, but I thought this would work
>
> PRINT *, 'Hello, world.'
> END
>
> This is what happened under NetBSD/i386 1.5.1:
>
> % g77 test.f
> /usr/lib/libg2c.so: warning: tempnam() possibly used unsafely, use mkstemp() or
> mkdtemp()
> % ./a.out
> Hello, world.
>
> So it does work, but why the warning? Have I omitted an obvious step?
>
>
> Ray
>
>
>