From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Attributes: gid103376,gid1094ba,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!news.litech.org!lnsnews.lns.cornell.edu!newsstand.cit.cornell.edu!artemis.acsu.buffalo.edu!news.cc.rochester.edu!not-for-mail From: Richard Edgar Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Bounds Check Overhead Date: Mon, 05 Jun 2006 09:50:15 -0400 Organization: University of Rochester Message-ID: References: <0ugu4e.4i7.ln@hunter.axlog.fr> <%P_cg.155733$eR6.26337@bgtnsc04-news.ops.worldnet.att.net> <6H9dg.10258$S7.9150@news-server.bigpond.net.au> <1hfv5wb.1x4ab1tbdzk7eN%nospam@see.signature> <4475DA61.3080001@comcast.net> <44762F55.4050106@cits1.stanford.edu> <87hd3d1472.fsf@ludovic-brenta.org> <1hfxsjh.t88mchrssv9cN%nospam@see.signature> <1hfy4xh.xeesc61gidq8eN%nospam@see.signature> NNTP-Posting-Host: pulsar.pas.rochester.edu Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: mail.rochester.edu 1149515415 3774 128.151.144.48 (5 Jun 2006 13:50:15 GMT) X-Complaints-To: abuse@rochester.edu NNTP-Posting-Date: Mon, 5 Jun 2006 13:50:15 +0000 (UTC) User-Agent: Thunderbird 1.5.0.2 (Macintosh/20060308) In-Reply-To: Xref: g2news2.google.com comp.lang.ada:4685 comp.lang.fortran:10670 Date: 2006-06-05T09:50:15-04:00 List-Id: Robert A Duff wrote: >>> Yes. Without an explicit INTENT(), Fortran defaults to INTENT(inout) >> That is not true. Fortran has 4 distinct intent() values - in, out, >> inout, and unspecified. All 4 are different. The unspecified case is >> sort of like inout, but it is *NOT* the same. >> >> The unspecified case is largely historical. ... [snip] > > Thanks for the good explanation. > > It seems that for newly-written Fortran, one would want a compiler > option that requires the INTENT to be specified. And passing a DO-loop > index variable as a parameter should require INTENT(in). In that case, > Fortran would be pretty much equivalent to Ada in this regard. I'm not sure... requiring INTENT would catch a lot of cases, but I don't think all. If I've understood the discussion, in Ada, looop counters are created specially for the loop? In Fortran, they are just ordinary variables. In particular, the counter could be a 'global' variable (I'll defer a detailed discussion about the meaning of 'global variable' in Fortran :-) ). This means that the loop counter could be modified through the 'global' reference, rather than the reference passed as an argument. I suppose an extremely sophisticated compiler/linker might catch that, but in practice, I think it requires a runtime check. Apologies to those who write the standards for my loose use of terminology, but I hope my point is clear ;-) Richard