Article View: comp.lang.fortran
Article #4535Re: IAND,IOR... - Thank you
From: drobinow
Date: Wed, 27 Jan 1993 22:30
Date: Wed, 27 Jan 1993 22:30
28 lines
2337 bytes
2337 bytes
In article <1993Jan26.190831.8026@newshost.lanl.gov>, jlg@cochiti.lanl.gov (J. Giles) writes: > I've never run across a Fortran implementation which did not have > these as operations as either intrinsic functions or operators which > are inlined and which use the hardware instructions (if the hardware > has them) to perform these operations. A glance at the document for > your particular Fortran implementation would probably have revealed a > non-clumsy Fortran solution. Certainly it's less clumsy to use a > implementation defined extension to Fortran than to rely on C (the > interface to which is also implementation defined and not portable). The original post mentioned that the compiler, if you can call it that, was f2c, which is a translator. The version of f2c which I have used does not recognize IAND,IOR, etc., as intrinsic functions and generates a function call. This turns out to be a mildly interesting problem if the Fortran program uses the aforementioned LOGICAL functions as generic, i.e., calling it with different data types within the same program. This creates a problem for the translator since it doesn't know how to prototype the function. My version of f2c (it's old, I don't know if there's anything newer) issues a warning in this case. The correct answer to the original question is, indeed, to write C code to implement the functions. I might be tempted to replace (inline) the function calls in the f2c output (C source) with the appropriate C code due to the problem I mentioned above. In any case, one must use code that is correct. David Robinow DROBINOW@falcon.aamrl.wpafb.af.mil Logicon Technical Services, Inc. P.O. Box 317258 Dayton, Ohio 45431-7258 (speaking for myself)
Technical Details
Message-ID:
<1993Jan27.173022.1924@falcon.aamrl.wpafb.af.mil>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!amdahl!rtech!pacbell.com!ames!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!udecc.engr.udayton.edu!blackbird.afit.af.mil!falcon.aamrl.wpafb.af.mil!drobinowReferences:
<1k1dcdINNpm3@rs2.hrz.th-darmstadt.de> <1993Jan26.190831.8026@newshost.lanl.gov>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!amdahl!rtech!pacbell.com!ames!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!udecc.engr.udayton.edu!blackbird.afit.af.mil!falcon.aamrl.wpafb.af.mil!drobinow From: drobinow@falcon.aamrl.wpafb.af.mil Newsgroups: comp.lang.fortran Subject: Re: IAND,IOR... - Thank you Message-ID: <1993Jan27.173022.1924@falcon.aamrl.wpafb.af.mil> Date: 27 Jan 93 17:30:22 EST References: <1k1dcdINNpm3@rs2.hrz.th-darmstadt.de> <1993Jan26.190831.8026@newshost.lanl.gov> Organization: USAF AL/CFH, WPAFB, Dayton, OH Lines: 29