Path: utzoo!attcan!uunet!husc6!necntc!ima!johnl From: johnl@ima.ISC.COM (John R. Levine) Newsgroups: comp.lang.fortran Subject: Re: fortran lint? Message-ID: <1059@ima.ISC.COM> Date: 9 Jun 88 22:11:22 GMT References: <3835@pasteur.Berkeley.Edu> <20089@beta.UUCP> Reply-To: johnl@ima.UUCP (John R. Levine) Organization: Not much Lines: 31 In article <20089@beta.UUCP> jlg@beta.UUCP (Jim Giles) writes: >Fortran is required to allow seperate compilation. Most compilers will >not notice the above as a problem. If the program and the subroutine >are seperately compiled, ther is NO WAY for the compiler to notice >the problem [of mismatched function arguments]. Not true at all. I have used systems in which the compiler places into object files information about argument types, and the linker can report mismatches. Certainly, 98% of existing linkers don't do this, but it's not all that hard to arrange and I expect that as CASE environments become better accepted you'll find this kind of cheking more often. As with all useful type checking systems, there are escapes for old code that cheats. [Later on Mr. Giles notes that Ada does exactly this kind of check, and an entry and a call match only if the name and also the arguments match.] >The C version of the above will usually work just as the Fortran version >did. LINT will identify this as a problem, but only if the two routines >are in the same file. Seperately compiled, even LINT won't find this >error. You must have a really weak version of lint. All of the lints I've ever used create a file full of type info for each source file you lint, then merge them all together and report inter-routine and inter-module type matching problems. More to the original point, I haven't seen any Fortran lints, though they'd surely be useful. Does PFORT do any inter-procedure checking? -- John R. Levine, IECC, PO Box 349, Cambridge MA 02238-0349, +1 617 492 3869 { ihnp4 | decvax | cbosgd | harvard | yale }!ima!johnl, Levine@YALE.something Rome fell, Babylon fell, Scarsdale will have its turn. -G. B. Shaw