Path: utzoo!attcan!uunet!husc6!cmcl2!beta!jlg From: jlg@beta.UUCP (Jim Giles) Newsgroups: comp.lang.fortran Subject: Re: fortran lint? Summary: seperate compilation and procedure type checking Message-ID: <20282@beta.UUCP> Date: 14 Jun 88 15:41:16 GMT References: <3835@pasteur.Berkeley.Edu> <20089@beta.UUCP> <1059@ima.ISC.COM> Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 38 In article <1059@ima.ISC.COM>, johnl@ima.ISC.COM (John R. Levine) writes: > In article <20089@beta.UUCP> jlg@beta.UUCP (Jim Giles) writes: > > [...] 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. This seems like exactly what I said: The COMPILER can't check! I have maintained both compilers and loaders on LANL Crays and have recommended this type of check for years. The present (and historical) compiler output tables had no place for the info and Cray didn't (until recently) see the need for it. The new tables have the space for this info and I am looking forward to some future loader which actually does the check. > [...] > >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. Possibly so, but I was talking about SEPERATELY COMPILED code. If you have all the sources you can clearly do LINT on the concatenated sum of all the source files (which is probably what happens when you say: lint file1 file2 ...) Seperately compiled usually means that the compile is being performed in the absence of other source (the rest of the code is, or will be, available ONLY as '*.o' files). Lint is of little help in this case. J. Giles Los Alamos