Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!njin!princeton!udel!wuarchive!emory!hubcap!mjs From: mjs@hubcap.clemson.edu (m j saltzman) Newsgroups: comp.lang.fortran Subject: Duplicate names in formal parameter lists Summary: Should this produce an error? Message-ID: <11084@hubcap.clemson.edu> Date: 22 Oct 90 16:49:10 GMT Distribution: usa Organization: Clemson University Lines: 22 I discovered an error in a FORTRAN program I was modifying, which amounts to the following: SUBROUTINE FOO(X, [other parameters], X) DOUBLE PRECISION X(N) [rest of code] This compiled without error on a Sun (with the -u flag) and on ULTRICS. Fortunately (?), the calling routine supplied the same argument in both positions, so no error occurred during execution. Questions: Is this really legal FORTRAN 77? If so, is it useful for anything? What are the semantics of a call to the routine with different arguments, say FOO(Y, ..., Z)? If not, why don't common compilers (at least these) detect the error? Other types of duplicate declarations are detected. Thanks for any insight. Matthew Saltzman mjs@clemson.edu