Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!turpin From: turpin@cs.utexas.edu (Russell Turpin) Newsgroups: comp.lang.fortran Subject: Re: Standard conformance Summary: Now that would be a truly wonderful compiler. Message-ID: <7002@cs.utexas.edu> Date: 6 Oct 89 20:25:14 GMT References: <1301@tukki.jyu.fi> <612@mbph.UUCP> Organization: U. Texas CS Dept., Austin, Texas Lines: 17 In article <612@mbph.UUCP>, hybl@mbph.UUCP (Albert Hybl Dept of Biophysics SM) writes: > It also contains another serious error; the variable I is used > in an expression before it is assigned a value. Is that legal > in X3.9-1978 fortran or is it just another allowed extension? > Are there any implementations that detect this type of error? > Why aren't all standard conforming compilers required to detect > and report such errors? ... Some compilers will tell you, in the obvious cases, that a variable is used before it is assigned a value. But determining in general whether or not every (or any or no) run of a program will use a variable before it has assigned the variable a value is impossible. (Exercise for reader: reduce to the halting problem.) Like array subscript errors, this kind of problem can only be fully detected at run-time in the cases in which it occurs. Russell