Article View: comp.sys.sun
Article #9528Re: exception handling in FORTRAN
From: Ralph Noack
Date: Sun, 11 Dec 1988 21:52
Date: Sun, 11 Dec 1988 21:52
43 lines
1902 bytes
1902 bytes
We too were shocked that flt pt exceptions were not being taken. Took me a
while to figure it out and longer to figure out how to turn it on. Here is
what we do under SunOS 4.0(I can send similiar for 3.x, they are
different.
We either link in a subroutine or include the code from a file such as
include '/usr/local/trap.i'
where /usr/local/trap.i contains
external abort
ieeer= ieee_handler('set','common',abort)
if (ieeer .ne. 0) then
write (0,'(''ieee_flags returned status='',i5)') ieeer
stop 'ieee_flags'
endif
The difficulty is that 4.0 has lots of problems and debugging is one of
them. With this include as the first executable statement in the main,
tracebacks are incorrect. To alleviate this I created a subroutine which I
added to /usr/lib/libF77.a I think. Replace the include above by the call
call trapfltpt
with the subroutine being:
subroutine trapfltpt
external abort
ieeer= ieee_handler('set','common',abort)
if (ieeer .ne. 0) then
write (0,'(''ieee_flags returned status='',i5)') ieeer
stop 'ieee_flags'
endif
return
end
either works fine regardless of floating pt hardware.
--
Ralph W. Noack (817)-273-2860
Univ. of Tx at Arlington, Aerospace Eng. Dept. Box 19018 Arlington, Tx 76019
..!{killer,texsun}!utacfd!rwn
Technical Details
Message-ID:
<8811230347.AA00536@utacfd>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!convex!killer!mit-eddie!uw-beaver!rice!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!convex!killer!mit-eddie!uw-beaver!rice!sun-spots-request From: texbell!killer!utacfd!rwn@cs.utexas.edu (Ralph Noack) Newsgroups: comp.sys.sun Subject: Re: exception handling in FORTRAN Message-ID: <8811230347.AA00536@utacfd> Date: 11 Dec 88 21:52:33 GMT Sender: usenet@rice.edu Organization: Rice University, Houston, Texas Lines: 43 Approved: Sun-Spots@rice.edu Original-Date: Tue, 22 Nov 88 21:47:13 CST X-Sun-Spots-Digest: Volume 7, Issue 43, message 5 of 15