comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Mariner 1 / FORTRAN bug
Date: Thu, 8 Aug 2019 19:26:28 +0200
Date: 2019-08-08T19:26:28+02:00	[thread overview]
Message-ID: <qihm04$h5a$1@dont-email.me> (raw)
In-Reply-To: <86986725-f34e-46d7-9efc-d15d94379048@googlegroups.com>

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

  reply	other threads:[~2019-08-08 17:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-12-04 20:18 C++ vs. Ada -- Is Ada loosing? happy.colorado.edu!srheintze
2019-08-08 15:23 ` robin.vowels
2019-08-12 15:47   ` Shark8
2019-08-08 15:40 ` Marina 1 / FORTRAN bug robin.vowels
2019-08-08 17:26   ` Jeffrey R. Carter [this message]
2019-08-09  1:57     ` Mariner " robin.vowels
2019-08-09  6:28       ` J-P. Rosen
2019-08-09  6:47         ` Niklas Holsti
2019-08-09 11:40           ` J-P. Rosen
2019-08-09 15:57           ` Jeffrey R. Carter
2019-08-09  8:38         ` Maciej Sobczak
2019-08-09 14:27           ` Nasser M. Abbasi
2019-08-09 21:05             ` Maciej Sobczak
2019-08-09 21:24               ` Lucretia
2019-08-09 22:03                 ` Paul Rubin
2019-08-08 17:51   ` Keith Thompson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox