Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!appserv!sun!amdcad!dgcad!dg-rtp!spam!cochran From: cochran@spam.rtp.dg.com (Dave Cochran) Newsgroups: comp.lang.fortran Subject: Re: Cheating on the types Message-ID: <1991Mar21.130821.16956@dg-rtp.dg.com> Date: 21 Mar 91 13:08:21 GMT References: <1991Mar20.195732.15376@appmag.com> Sender: usenet@dg-rtp.dg.com (Usenet Administration) Reply-To: cochran@spam.rtp.dg.com (Dave Cochran) Organization: Data General Corporation, Research Triangle Park, NC Lines: 33 In article <1991Mar20.195732.15376@appmag.com>, pa@appmag.com (Pierre Asselin) writes: |> This simplified fragment violates the standard by passing reals to a |> routine that expects integers. |> |> program wrong |> real rin, rout |> rin= 0.577215665 ! or whatever... |> call icopy(rin, rout) |> write(6,*) rout |> end |> |> subroutine icopy(iin, iout) |> integer iin, iout |> iout= iin |> return |> end |> |> Seems fairly innocuous, though. Q: are there implementations |> where it would fail ? |> Oh yes. In Green Hills F77 for the Motorola 88000, it would die with a bus error because the reals will default to real*4, with a 32 bit alignment, and the integers will default to int*2, with a 16 bit alignment. I see this all the time. -- +------------------------------------------------------+ |Dave Cochran (cochran@spam.rtp.dg.com) | |Data General Corporation, Research Triangle Park, NC | +------------------------------------------------------+ |"Outside of a dog, a book is man's best friend. | | Inside of a dog it's too dark to read." -Groucho Marx| +------------------------------------------------------+