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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Thread: 101deb,15c6ed4b761968e6 X-Google-Attributes: gid103376,gid1094ba,gid101deb,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!ken-transit.news.telstra.net!ken-in.news.telstra.net!news.telstra.net!news-server.bigpond.net.au!53ab2750!not-for-mail From: "robin" Newsgroups: comp.lang.ada,comp.lang.fortran,comp.lang.pl1 References: <1hfv5wb.1x4ab1tbdzk7eN%nospam@see.signature> <2OEdg.167448$eR6.128849@bgtnsc04-news.ops.worldnet.att.net> Subject: Re: Checking for Undefined X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Sat, 27 May 2006 14:29:29 GMT NNTP-Posting-Host: 144.139.71.84 X-Complaints-To: abuse@bigpond.net.au X-Trace: news-server.bigpond.net.au 1148740169 144.139.71.84 (Sun, 28 May 2006 00:29:29 EST) NNTP-Posting-Date: Sun, 28 May 2006 00:29:29 EST Organization: BigPond Internet Services Xref: g2news2.google.com comp.lang.ada:4537 comp.lang.fortran:10348 comp.lang.pl1:1764 Date: 2006-05-27T14:29:29+00:00 List-Id: "Dick Hendrickson" wrote in message news:2OEdg.167448$eR6.128849@bgtnsc04-news.ops.worldnet.att.net... > This isn't really relevant to the post I'm replying to, but > my newsreader has lost the one I wanted to reply to. Sorry. > > There's a deep problem in Fortran with detecting usage of > undefined variables. The problem is that an error condition > during input causes all input items to become undefined. > Given a statement like > read (unit, err = 100) j, x(j), j, x(j) > What's supposed to happen? If the error occurs after the > second read of "j", how does the processor go back and > flag the first instance of x([old value of]j) as undefined > when "j" no longer has the old value? Sure, in this > example it's easy enough for the processor to keep a little > list of variables. But, what if the input list is inside > an do-loop that goes from 1 to some huge number. There's > no practical way to keep the list of potentially undefined > values. By keeping a shadow array of bits, any undefined value can be flagged. > You can't spray the array with "undefined" flags > before the input, since not all values are necessarily > changed. You can't make a shadow copy of the array and > look for changed elements, because input doesn't have to > change the value in an element and making a shadow copy > of a million word array is impractical. It isn't impractical, because only 3% of additional storage is required (see above). > I think there are cases in Fortran where usage of what > the language calls undefined variables is not detectable > in any practical sense of the word. See above.