From nobody@FreeBSD.org  Sun Jan 28 11:02:13 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id F39B637B400
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 28 Jan 2001 11:02:12 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f0SJ2C716142;
	Sun, 28 Jan 2001 11:02:12 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200101281902.f0SJ2C716142@freefall.freebsd.org>
Date: Sun, 28 Jan 2001 11:02:12 -0800 (PST)
From: c_sudan@email.msn.com
To: freebsd-gnats-submit@FreeBSD.org
Subject: tempnam() possibly used unsafely by libg2c.so during FORTRAN compilation
X-Send-Pr-Version: www-1.0

>Number:         24701
>Category:       i386
>Synopsis:       tempnam() possibly used unsafely by libg2c.so during FORTRAN compilation
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 28 11:10:01 PST 2001
>Closed-Date:    Wed Jan 16 14:53:25 PST 2002
>Last-Modified:  Wed Jan 16 14:55:02 PST 2002
>Originator:     Nick Sudan
>Release:        4.1 Release
>Organization:
>Environment:
FreeBSD  4.1-RELEASE FreeBSD 4.1-RELEASE #0: Fri Jul 28 14:30:31 GMT 2000 jkh@ref.freebsd.org:/usr/src/sys/compile/GENERIC  i386
>Description:
Compiling/executing a FORTRAN program fails, with the following message displayed: "/usr/lib/libg2c.so: warning: tempnam() possibly used unsafely; consider using mkstemp()".  I'm pretty sure that it is not a problem with my Fortran program (I started with one that is ridiculously simple and tried others) or OS or library modifications (see "how to repeat the problem").

p.s. sorry if this is not the right forum for this problem (I'm a newbie)-- please point me in the right direction if it is the wrong forum.
>How-To-Repeat:
Start with a fresh PC, nothing on the hard drive (i.e. no partitions).  Install FreeBSD from the CD ROM using the X User distribution.  Reboot from the hardrive, login, create the simplest FORTRAN program you can think of with the .f extension (I tried other extensions, and they producted the same problem), use f77 to compile/execute the program, and before you get any output from the program, the above error message appears.  In short, the most vanilla version of FreeBSD will not let you use the Fortran compiler! (it is the single reason I purchased FreeBSD, for a Fortran compiler and UNIX based OS)

For example, I created nick.f with the following contents:
       PROGRAM NICK
       PRINT *, 'HELLO'
       END
Then, from the command line I typed "f77 nick.f".  Bingo, error message, and no "HELLO" on my screen.


>Fix:
I wish I knew!

>Release-Note:
>Audit-Trail:

From: Thomas Moestl <tmoestl@gmx.net>
To: freebsd-gnats-submit@FreeBSD.org, c_sudan@email.msn.com
Cc:  
Subject: Re: i386/24701: tempnam() possibly used unsafely by libg2c.so during FORTRAN compilation
Date: Sun, 28 Jan 2001 21:22:40 +0100

 > Compiling/executing a FORTRAN program fails, with the following 
 > message displayed: "/usr/lib/libg2c.so: warning: tempnam() possibly 
 > used unsafely; consider using mkstemp()".  I'm pretty sure that it is 
 > not a problem with my Fortran program (I started with one that is 
 > ridiculously simple and tried others) or OS or library modifications 
 > (see "how to repeat the problem").
 As the message says, this is a warning, not an error.
 
 > For example, I created nick.f with the following contents:
 >            PROGRAM NICK
 >            PRINT *, 'HELLO'
 >            END
 >     Then, from the command line I typed "f77 nick.f".  Bingo, error 
 > message, and no "HELLO" on my screen.
 f77 compiles your program, but will not execute it. You should find
 the executable a.out in your working directory that was compiled
 from your program source code. "./a.out" in a shell should print
 the HELLO ;-)
 "man f77" should give further details.
 
 	- thomas
 
 
State-Changed-From-To: open->closed 
State-Changed-By: ashp 
State-Changed-When: Wed Jan 16 14:53:25 PST 2002 
State-Changed-Why:  
As per the followup by Thomas Moestl, you have to type ./a.out to run 
the program.  The reported error was also simply a warning.  No problem 
here. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=24701 
>Unformatted:
