Xref: utzoo comp.lang.fortran:717 comp.software-eng:612 Path: utzoo!dciem!nrcaer!scs!spl1!laidbak!att!pacbell!ames!killer!tness7!tness1!nuchat!sugar!ssd From: ssd@sugar.UUCP (Scott Denham) Newsgroups: comp.lang.fortran,comp.software-eng Subject: Re: Fortran follies Message-ID: <2082@sugar.UUCP> Date: 4 Jun 88 06:34:27 GMT Article-I.D.: sugar.2082 References: <5377@cup.portal.com> <2852@mmintl.UUCP> <1005@cresswell.quintus.UUCP> Organization: Sugar Land UNIX - Houston, TX Lines: 28 Summary: taking the "proper way" a step farther In article <1005@cresswell.quintus.UUCP>, ok@quintus.UUCP (Richard A. O'Keefe) writes: > In article <2852@mmintl.UUCP>, franka@mmintl.UUCP (Frank Adams) writes: > > In article <5377@cup.portal.com> Paul_L_Schauble@cup.portal.com writes: > > I would recommend that you regard a dimension of 1 for an argument as > > meaning that the dimension is undefined. It's not pretty, but it works. > This has never been strictly legal. Fortran 77, unless I am much mistaken, > has a "proper" way of doing it: the last (and only the last) dimension of > a formal array parameter may be '*'. So this declaration should read > real a(*), b(*) > A Fortran compiler is entitled to generate code to check the actual > subscripts against the declared dimensions. Agreed, the RIGHT way to do it in '77 is to use the * - I've always disliked the use of anything other than a variable or a * for a dummy array as it implies information (true array extent) that's very often not true. A Fortran compiler certainly IS entitled to do run-time sub- script checking, but I'd hate to see what the impact would be on a real set of production codes using a high level of subroutine nesting. It's a great thing to have during development and debugging but it's just not realistic in many environments. In the case that subscript checking is NOT being done, than the best thing the compiler designer can do for the user is assume that the last (and only the last) dimension of ANY array received as an argument is in fact unknown, be it specified as 1, 100, ISIZE, or *. Why break existing code if you can avoid it ??? Scott S. Denham Western Atlas International Houston, TX