Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!samsung!cs.utexas.edu!sun-barr!newstop!exodus!exodus-bb!khb From: khb@chiba.Eng.Sun.COM (Keith Bierman fpgroup) Newsgroups: comp.lang.fortran Subject: Re: max function in dim. stmt in sun f77 1.3.1 Message-ID: Date: 6 Feb 91 03:04:39 GMT References: Sender: news@exodus.Eng.Sun.COM Distribution: comp Organization: Sun MegaSystems Lines: 38 In-reply-to: mclay@vato.ae.utexas.edu's message of 5 Feb 91 16:30:05 GMT In article mclay@vato.ae.utexas.edu (Robert McLay) writes: Under sun f77 v1.3.1 it now complains about the use of the max function in an adjustable array dimension statement. This use to work in version 1.2 and before. ... integer a(m),g(max(1,n)) Page 5-2 of our favorite book (X3.9-1978) ...definition of an array declarator in progress...A dimenion bund expression must not contain a function or array element reference.... So this is illegal (non-standard, to be a bit more precise). So why did it work before ? bugid 1021366 adjustable array declarations not checked (I'm simplifying). There are also bugids for generating wrong code when the expression evaluated to zero, etc. (since it was the last dimension, it really didn't matter what was returned for most cases ... 0 was a bad counter-example). The fix (which made a bunch of folks happy) was to provide a bit of testing to ensure sanity. The obvious way to construct such tests is to follow the standard. Now, allowing certain functions is feasible (f90 committee time was spent debating it extensively). But we just had a thread where a poster argued that extensions are somewhat evil.... votes gents and ladies? Should we allow this in a future version (too late for v1.4)? Should it be tied to the -xl switch (act a bit more vaxlike)? -- ---------------------------------------------------------------- Keith H. Bierman kbierman@Eng.Sun.COM | khb@chiba.Eng.Sun.COM SMI 2550 Garcia 12-33 | (415 336 2648) Mountain View, CA 94043