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