From kargl@troutmask.apl.washington.edu  Tue Aug  1 18:26:20 1995
Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.97.216])
          by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id SAA20800
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 1 Aug 1995 18:26:19 -0700
Received: (from kargl@localhost) by troutmask.apl.washington.edu (8.6.11/8.6.9) id SAA25513; Tue, 1 Aug 1995 18:27:15 -0700
Message-Id: <199508020127.SAA25513@troutmask.apl.washington.edu>
Date: Tue, 1 Aug 1995 18:27:15 -0700
From: "Steven G. Kargl" <kargl@troutmask.apl.washington.edu>
Reply-To: kargl@troutmask.apl.washington.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: F77 (or f2c) format conversion bug
X-Send-Pr-Version: 3.2

>Number:         648
>Category:       bin
>Synopsis:       [f2c] printf format conversion incorrect (duplicate)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jmz
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug  1 18:30:01 PDT 1995
>Closed-Date:    Mon Mar 31 18:32:59 PST 1997
>Last-Modified:  Mon Mar 31 18:34:07 PST 1997
>Originator:     Steven G. Kargl
>Release:        FreeBSD 2.0-BUILT-19950706 i386
>Organization:
Steven G. Kargl     | Phone: 206-685-4677 |
Applied Physics Lab | Fax:   206-543-6785 |
Univ. of Washington |---------------------|
1013 NE 40th St     | FreeBSD 2.2-CURRENT |
Seattle, WA 98105   |---------------------|
>Environment:

Not sure why the Release: tag above says FreeBSD 2.0-BUILT-19950706.
I am supping the the 2.2-current branch daily with `make world' run
every Friday.

%uname -a
FreeBSD troutmask.apl.washington.edu 2.2-CURRENT FreeBSD 2.2-CURRENT
#0: Fri Jul 28 07:36:01 PDT 1995
root@troutmask.apl.washington.edu:/usr/src/sys/compile/TROUTMASK  i386



>Description:
When the following program is compiled and the resulting executable
is run, the formatted output is incorrect.  Either the f2c I/O routines
are not handling the formatted I/O correctly, or the underlying FreeBSD
C library is messed up.

      program test.f
      double precision a
      integer i
      a = 1.d97
      do 5 i = 1, 3  
         a = a * 10.d0
         write(6,10) a
         write(6,11) a
         write(6,12) a
         write(6,*) a
         print*
5     continue
10    format(E9.1)
11    format(D9.1)
12    format(G9.1)
      end

This is the output.

   .1E+99
   .1E+99
   .1E+99
  1.E+98

   .1+100     This should be .1E+100
   .1+100     This should be .1E+100
   .1+100     This should be .1E+100
  1.E+99      Correct value

   .1+101     This should be .1E+101
   .1+101     This should be .1E+101
   .1+101     This should be .1E+101
  1.E+100     Correct value


>How-To-Repeat:

%f77 -o test test.f
%test

>Fix:

The library code needs to be fixed or we have to fix F77 if the library
code behavior is defined by POSIX.  This is a duplicate of a previous
bug by another submitter.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bde 
Responsible-Changed-By: pst 
Responsible-Changed-When: Wed Feb 7 16:43:34 PST 1996 
Responsible-Changed-Why:  
Bruce did the analysis on the other bug. 
Responsible-Changed-From-To: bde->freebsd-bugs 
Responsible-Changed-By: bde 
Responsible-Changed-When: Tue Dec 17 03:47:21 PST 1996 
Responsible-Changed-Why:  
I won't be fixing this soon. 
I checked that the problem is in f2c, not in libc. 
Responsible-Changed-From-To: freebsd-bugs->jmz 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Fri Feb 21 11:25:21 PST 1997 
Responsible-Changed-Why:  
Last person to import a new version of f2c, and the problem 
still exists under -current. 
State-Changed-From-To: open->closed 
State-Changed-By: jmz 
State-Changed-When: Mon Mar 31 18:32:59 PST 1997 
State-Changed-Why:  
Bug fixed in revision 1.4 of wref.c. 

>Unformatted:
