home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / fortran / 4260 < prev    next >
Encoding:
Internet Message Format  |  1992-11-10  |  1.6 KB

  1. Xref: sparky comp.lang.fortran:4260 comp.sys.hp:12757
  2. Newsgroups: comp.lang.fortran,comp.sys.hp
  3. Path: sparky!uunet!stanford.edu!leland.Stanford.EDU!ungar
  4. From: ungar@leland.Stanford.EDU (Jeffrey Ungar)
  5. Subject: Re: Weird HP compiler warning
  6. Message-ID: <1992Nov10.210300.2732@leland.Stanford.EDU>
  7. Sender: news@leland.Stanford.EDU (Mr News)
  8. Organization: DSG, Stanford University, CA 94305, USA
  9. References: <1992Nov10.193635.2736@alchemy.chem.utoronto.ca>
  10. Date: Tue, 10 Nov 92 21:03:00 GMT
  11. Lines: 30
  12.  
  13. In article <1992Nov10.193635.2736@alchemy.chem.utoronto.ca> mroussel@alchemy.chem.utoronto.ca (Marc Roussel) writes:
  14. >
  15. >     I usually like my compilers to give me a lot of warnings, even when
  16. >they are most likely useless.  In this case however, I have run across
  17. >one warning whose meaning I cannot fathom.  Consider the following short
  18. >program:
  19. >
  20. >      double precision h,nexth,err,d2fex
  21. >      h = 1.d0
  22. >      err = 10.d0
  23. >      d2fex = 123.d0
  24. >          nexth = min(h,sqrt(12.d0*err/d2fex))
  25. >      write(*,*)nexth
  26. >      END
  27. >
  28. >For this piece of code, the compiler produces the warning
  29. >
  30. >Warning on line 5 of weird.f: Argument has same name as INTRINSIC function
  31.  
  32. That's because it looks (almost) like you are trying to pass a function,
  33. namely the intrinsic function SQRT, to the MIN() function. Of course, if
  34. you *really* wanted to use SQRT as a subprogram argument, you would
  35. declare it in an INTRINSIC statement, and just write the name "SQRT" in
  36. the argument list (but not, I would suggest, to the MIN routine!)
  37.  
  38. It appears this warning is in keeping with your preference for having
  39. lots of warnings, even silly ones :-)
  40.  
  41. PJU
  42.  
  43.