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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Mariner 1 / FORTRAN bug Date: Thu, 8 Aug 2019 19:26:28 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <1992Dec4.141816.1@happy.colorado.edu> <86986725-f34e-46d7-9efc-d15d94379048@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 8 Aug 2019 17:26:28 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="911e5264f7907cda206d7876c844bc2b"; logging-data="17578"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pVNuz4WQ32JUbGiHLkatf2ESBDpxfxWc=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Cancel-Lock: sha1:XOlsTla4vMuJdOrYxCeTVd6YPS8= In-Reply-To: <86986725-f34e-46d7-9efc-d15d94379048@googlegroups.com> Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:57012 Date: 2019-08-08T19:26:28+02:00 List-Id: On 8/8/19 5:40 PM, robin.vowels@gmail.com wrote: > > DO 15 I = 1.100 > > when what should have been written was: > > DO 15 I = 1,100 > > but somehow a dot had replaced the comma. Because Fortran ignores spaces, this was seen by the compiler as: > > DO15I = 1.100 > which is a perfectly valid assignment to a variable called DO15I and not at all what was intended." Some people on here may not be aware that FORTRAN did not require declaration of variables, so the above would create a new variable DO15I. I don't know what flavor of FORTRAN was used in Mariner 1, but FORTRAN 66 added the IMPLICIT statement, which declared the type used for undeclared variables. Adding IMPLICIT LOGICAL A-Z at the beginning of your code helped to catch these kinds of things. FORTRAN 77 added IMPLICIT NONE, which required you to declare all variables. Sometime in the late 1970s-early 1980s people moved away from punched cards in ALL UPPER CASE and started calling the language Fortran. Given the kind of testing such software would have undergone, I somehow doubt that an absence of looping would have gone unnoticed, so I suspect this story is apocryphal. While it probably didn't cause the failure of a space probe, people did get bitten by this language design flaw, which is an example of a single-character error (added, omitted, or changed) that results in valid code. This is something that competent language designers go to great lengths to avoid. Note that C and most of its descendants (most of the commonly used languages today) have this flaw. -- Jeff Carter "I like it when the support group complains that they have insufficient data on mean time to repair bugs in Ada software." Robert I. Eachus 91