Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!ux1.cso.uiuc.edu!pluto!hirchert From: hirchert@pluto.ncsa.uiuc.edu (Kurt Hirchert) Newsgroups: comp.lang.fortran Subject: Re: Duplicate names in formal parameter lists Message-ID: <1990Oct22.202712.29478@ux1.cso.uiuc.edu> Date: 22 Oct 90 20:27:12 GMT References: <11084@hubcap.clemson.edu> Sender: news@ux1.cso.uiuc.edu (News) Reply-To: hirchert@pluto.ncsa.uiuc.edu (Kurt Hirchert) Distribution: usa Organization: National Center for Supercomputing Applications Lines: 31 In article <11084@hubcap.clemson.edu> mjs@hubcap.clemson.edu (m j saltzman) writes: >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 This is _not_ legal FORTRAN 77. Since compilers on rather unlike machines failed to complain about it, I assume some vendor must have created a useful extension using that syntax and that other vendors then copied it. I have no idea what that extension might actually do. -- Kurt W. Hirchert hirchert@ncsa.uiuc.edu National Center for Supercomputing Applications