🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.dec
Article #986

Re: Fortran bug?

#986
From: Michael Carter 1639503
Date: Tue, 05 Dec 1989 17:16
44 lines
2037 bytes
In article <7120@pt.cs.cmu.edu> epperly@osnome.che.wisc.edu (Tom Epperly) writes:
>The following short fortran program gives a
>Fatal error in: /usr/lib/fcom1.31 Segmentation fault
>Nice error message!  I really don't know fortran, so I am not sure if this
>is a bug in the compiler or not.  Line seven is the line which causes the
>compiler to die(the one with the MOD).
>
>	PROGRAM test
>	IMPLICIT none
>	INTEGER level, igr
>	igr = 1
>	level = 2
>	igr = MOD(level,INT(10.0))
>	END
>

We ran into a similar situation on the 3100.  The problem is probably
caused by the use of INT inside the MOD function.  According to DEC, 
the MIPS Fortran compiler doesn't support (at least on the 3100) type
conversion of a CONSTANT (variables work okay) within a function call,
using the intrinsic conversion functions. 

You can use:  
   igr = MOD (level,10)

or you can use:
   itemp=INT(10.0)
   igr = MOD(level,itemp)

or you can use:
   igr = MOD(level,INTUSE(10.0))
   (where INTUSE is a user-defined conversion function (which could just 
   call the INT function))

or you can use:
   temp=10.0
   igr = MOD(level,INT(temp))

>Lastly, I am posting this for one of the users on our system; and I don't know
>why he wrote the MOD that way.

I'm not sure why anyone would want to do that either, but we tripped over the
same thing, so your user's programming style isn't entirely unique :-), even
though it may not be good programming practice.
Technical Details
Message-ID: <20@bcrka80.bnr.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!bnrgate!bnr!bcrka80.bnr.ca!carterm
References: <7120@pt.cs.cmu.edu> <128675@sun.Eng.Sun.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!bnrgate!bnr!bcrka80.bnr.ca!carterm
From: carterm@bcrka80.bnr.ca (Michael Carter 1639503)
Newsgroups: comp.sys.dec
Subject: Re: Fortran bug?
Summary: an unsupported option
Keywords: fortran language f77 mod
Message-ID: <20@bcrka80.bnr.ca>
Date: 5 Dec 89 17:16:25 GMT
References: <7120@pt.cs.cmu.edu> <128675@sun.Eng.Sun.COM>
Sender: cadnews@bnr.CA
Reply-To: carterm@bcrka80.UUCP (Michael Carter 1639503)
Followup-To: comp.sys.dec
Distribution: na
Organization: bnr
Lines: 44