From owner-cvs-all Mon Jan 18 00:18:20 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA07993 for cvs-all-outgoing; Mon, 18 Jan 1999 00:18:20 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from mail.sat.t.u-tokyo.ac.jp (dryad.sat.t.u-tokyo.ac.jp [133.11.156.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA07984; Mon, 18 Jan 1999 00:18:14 -0800 (PST) (envelope-from simokawa@sat.t.u-tokyo.ac.jp) Received: from ett.sat.t.u-tokyo.ac.jp (ett.sat.t.u-tokyo.ac.jp [133.11.156.43]) by mail.sat.t.u-tokyo.ac.jp (8.8.6/3.4Wbeta6-SAT1.0) with ESMTP id RAA04547; Mon, 18 Jan 1999 17:18:05 +0900 (JST) (envelope-from simokawa@sat.t.u-tokyo.ac.jp) Received: from localhost by ett.sat.t.u-tokyo.ac.jp (8.8.8/sat-V0.6) id RAA16936; Mon, 18 Jan 1999 17:18:04 +0900 (JST) To: cvs-committers@FreeBSD.ORG Cc: dfr@FreeBSD.ORG, sgk@troutmask.apl.washington.edu Subject: Re: cvs commit: src/usr.bin/f2c proc.c In-Reply-To: Your message of "Sun, 10 Jan 1999 11:50:03 -0800 (PST)" <199901101950.LAA03808@troutmask.apl.washington.edu> References: <199901101950.LAA03808@troutmask.apl.washington.edu> X-Face: OE([KxWyJI0r[R~S/>7ia}SJ)i%a,$-9%7{*yihQk|]gl}2p#"oXmX/fT}Bn7:#j7i14gu$ jgR\S*&C3R/pJX Date: Mon, 18 Jan 1999 17:18:04 +0900 From: Hidetoshi Shimokawa X-Dispatcher: imput version 980905(IM100) Lines: 113 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk From: Steve Kargl Subject: Re: cvs commit: src/usr.bin/f2c proc.c Date: Sun, 10 Jan 1999 11:50:03 -0800 (PST) Message-ID: <199901101950.LAA03808@troutmask.apl.washington.edu> sgk> According to Doug Rabson: sgk> > dfr 1999/01/10 09:22:51 PST sgk> > sgk> > Modified files: sgk> > usr.bin/f2c proc.c sgk> > Log: sgk> > From the submitter: sgk> > sgk> > I found the reason why f77 so offen dies on alpha. Here is a fix. sgk> > "Const" is a union of int and double. sgk> > If nelt->constblock.Const.ci > 0 then it trys to evaluate it as double sgk> > and floating point exception occurs. sgk> > sgk> sgk> There may be worse problems with f2c on alpha machines. My Alphastation sgk> runs Digital Unix, so I haven't had a channce to FreeBSD/axp. sgk> sgk> From http://www.netlib.org/f2c/readme: sgk> sgk> sgk> NOTE: f2c.h defines several types, e.g., real, integer, doublereal. sgk> The definitions in f2c.h are suitable for most machines, but if sgk> your machine has sizeof(double) > 2*sizeof(long), you may need sgk> to adjust f2c.h appropriately. f2c assumes sgk> sizeof(doublecomplex) = 2*sizeof(doublereal) sgk> sizeof(doublereal) = sizeof(complex) sgk> sizeof(doublereal) = 2*sizeof(real) sgk> sizeof(real) = sizeof(integer) sgk> sizeof(real) = sizeof(logical) sgk> sizeof(real) = 2*sizeof(shortint) sgk> EQUIVALENCEs may not be translated correctly if these sgk> assumptions are violated. sgk> sgk> On machines, such as those using a DEC Alpha processor, on sgk> which sizeof(short) == 2, sizeof(int) == sizeof(float) == 4, sgk> and sizeof(long) == sizeof(double) == 8, it suffices to sgk> modify f2c.h by removing the first occurrence of "long " sgk> on each line containing "long ", e.g., by issuing the sgk> commands sgk> mv f2c.h f2c.h0 sgk> sed 's/long //' f2c.h0 >f2c.h sgk> On such machines, one can enable INTEGER*8 by uncommenting sgk> the typedef of longint in f2c.h, so it reads sgk> typedef long longint; sgk> by compiling libI77 with -DAllow_TYQUAD, and by adjusting sgk> libF77/makefile as described in libF77/README. sgk> sgk> Some machines may have sizeof(int) == 4, sizeof(float) == 8, sgk> and sizeof(long long) == 8. On such machines, adjust f2c.h sgk> by changing "long int " to "long long ", e.g., by saying sgk> mv f2c.h f2c.h0 sgk> sed 's/long int /long long /' f2c.h0 >f2c.h sgk> One can enable INTEGER*8 on such machines as described sgk> above, but with sgk> typedef long long longint; sgk> sgk> sgk> -- sgk> Steve sgk> sgk> finger kargl@troutmask.apl.washington.edu sgk> http://troutmask.apl.washington.edu/~clesceri/kargl.html sgk> If nobody objects, I would like to commit following patch. This patch should have no effect on i386, because 'long' == 'int' on i386. Index: f2c.h =================================================================== RCS file: /pub/FreeBSD-CVS/src/usr.bin/f2c/f2c.h,v retrieving revision 1.3 diff -u -r1.3 f2c.h --- f2c.h 1997/04/13 01:12:42 1.3 +++ f2c.h 1999/01/13 05:40:05 @@ -7,15 +7,15 @@ #ifndef F2C_INCLUDE #define F2C_INCLUDE -typedef long int integer; -typedef unsigned long uinteger; +typedef int integer; +typedef unsigned int uinteger; typedef char *address; typedef short int shortint; typedef float real; typedef double doublereal; typedef struct { real r, i; } complex; typedef struct { doublereal r, i; } doublecomplex; -typedef long int logical; +typedef int logical; typedef short int shortlogical; typedef char logical1; typedef char integer1; @@ -42,9 +42,9 @@ typedef short ftnlen; typedef short ftnint; #else -typedef long int flag; -typedef long int ftnlen; -typedef long int ftnint; +typedef int flag; +typedef int ftnlen; +typedef int ftnint; #endif /*external read, write*/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message