home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / fortran / 5228 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.2 KB

  1. Path: 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
  2. From: drobinow@falcon.aamrl.wpafb.af.mil
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: IAND,IOR... - Thank you
  5. Message-ID: <1993Jan27.173022.1924@falcon.aamrl.wpafb.af.mil>
  6. Date: 27 Jan 93 17:30:22 EST
  7. References: <1k1dcdINNpm3@rs2.hrz.th-darmstadt.de> <1993Jan26.190831.8026@newshost.lanl.gov>
  8. Organization: USAF AL/CFH, WPAFB, Dayton, OH
  9. Lines: 29
  10.  
  11. In article <1993Jan26.190831.8026@newshost.lanl.gov>, jlg@cochiti.lanl.gov (J. Giles) writes:
  12. > I've never run across a Fortran implementation which did not have 
  13. > these as operations as either intrinsic functions or operators which 
  14. > are inlined and which use the hardware instructions (if the hardware 
  15. > has them) to perform these operations.  A glance at the document for 
  16. > your particular Fortran implementation would probably have revealed a 
  17. > non-clumsy Fortran solution.  Certainly it's less clumsy to use a
  18. > implementation defined extension to Fortran than to rely on C (the
  19. > interface to which is also implementation defined and not portable).
  20.  The original post mentioned that the compiler, if you can call it that, was
  21. f2c, which is a translator. The version of f2c which I have used does not
  22. recognize IAND,IOR, etc., as intrinsic functions and generates a function
  23. call.
  24.  This turns out to be a mildly interesting problem if the Fortran program
  25. uses the aforementioned LOGICAL functions as generic, i.e., calling it with
  26. different data types within the same program. This creates a problem for
  27. the translator since it doesn't know how to prototype the function. My
  28. version of f2c (it's old, I don't know if there's anything newer) issues a
  29. warning in this case.
  30.  The correct answer to the original question is, indeed, to write C code to
  31. implement the functions. I might be tempted to replace (inline) the function
  32. calls in the f2c output (C source) with the appropriate C code due to the
  33. problem I mentioned above. In any case, one must use code that is correct.
  34.  
  35. David Robinow        DROBINOW@falcon.aamrl.wpafb.af.mil
  36. Logicon Technical Services, Inc.
  37. P.O. Box 317258
  38. Dayton, Ohio 45431-7258          (speaking for myself)
  39.  
  40.