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!border1.nntp.dca.giganews.com!nntp.giganews.com!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!b680011b!not-for-mail From: Dick Hendrickson User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.fortran,comp.lang.pl1 Subject: Re: Checking for Undefined References: <1hfv5wb.1x4ab1tbdzk7eN%nospam@see.signature> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <2OEdg.167448$eR6.128849@bgtnsc04-news.ops.worldnet.att.net> NNTP-Posting-Host: 7ff879467453a590abe433bc31659d13 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1148655870 7ff879467453a590abe433bc31659d13 (Fri, 26 May 2006 15:04:30 GMT) NNTP-Posting-Date: Fri, 26 May 2006 15:04:30 GMT Organization: AT&T Worldnet Date: Fri, 26 May 2006 15:04:30 GMT Xref: g2news2.google.com comp.lang.ada:4496 comp.lang.fortran:10293 comp.lang.pl1:1740 Date: 2006-05-26T15:04:30+00:00 List-Id: 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. 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. 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. Dick Hendrickson