From owner-freebsd-bugs Tue Aug 1 18:30:02 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id SAA20934 for bugs-outgoing; Tue, 1 Aug 1995 18:30:02 -0700 Received: (from gnats@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id SAA20927 ; Tue, 1 Aug 1995 18:30:01 -0700 Resent-Date: Tue, 1 Aug 1995 18:30:01 -0700 Resent-Message-Id: <199508020130.SAA20927@freefall.cdrom.com> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.cdrom.com, kargl@troutmask.apl.washington.edu 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 ; 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" Reply-To: kargl@troutmask.apl.washington.edu To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/648: F77 (or f2c) format conversion bug Sender: bugs-owner@freebsd.org Precedence: bulk >Number: 648 >Category: bin >Synopsis: Formatted output is not converted correctly >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 1 18:30:01 PDT 1995 >Last-Modified: >Originator: Steven G. Kargl >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 |---------------------| >Release: FreeBSD 2.0-BUILT-19950706 i386 >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 work-around is to avoid formatted output. This really is not an option with legacy F77 code. Upgrading to the latest version of f2c might fix this problem. I'm in the process of upgrading my locate source tree. >Audit-Trail: >Unformatted: