Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!maverick.ksu.ksu.edu!mac From: mac@cis.ksu.edu (Myron A. Calhoun) Newsgroups: comp.lang.fortran Subject: Re: Cheating on the types Message-ID: <1991Mar21.135736.11830@maverick.ksu.ksu.edu> Date: 21 Mar 91 13:57:36 GMT References: <1991Mar20.195732.15376@appmag.com> <4554@alliant.Alliant.COM> Sender: news@maverick.ksu.ksu.edu (The News Guru) Organization: Kansas State University Lines: 31 tj@Alliant.COM (Tom Jaskiewicz) writes: >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 deleted for brevity] >>Seems fairly innocuous, though. Q: are there implementations >>where it would fail ? >Yes. It been 10 years since I've used one, but there is at least one >Fortran implementation that uses 16 bit INTEGER's and 32 bit REAL's. >(this in itself violates Fortran-77). Well, DOUBLE PRECISION and INTEGER do NOT violate the standard, and they would fail, too. So would a similar program which asked the subroutine to copy an array with a single assignment statement. And for the same reason: the subroutine does not automagically know the LENGTH of the parameters, only the address of their first part. --Myron. --Myron. -- # Myron A. Calhoun, Ph.D. E.E.; Associate Professor (913) 539-4448 home # INTERNET: mac@cis.ksu.edu (129.130.10.2) 532-6350 work # UUCP: ...rutgers!ksuvax1!harry!mac 532-7353 fax # AT&T Mail: attmail!ksuvax1!mac W0PBV @ K0VAY.KS.USA.NA