comp.lang.ada
 help / color / mirror / Atom feed
From: robin.vowels@gmail.com
Subject: Re: Mariner 1 / FORTRAN bug
Date: Thu, 8 Aug 2019 18:57:35 -0700 (PDT)
Date: 2019-08-08T18:57:35-07:00	[thread overview]
Message-ID: <97509e4d-05b9-4b6a-ab12-613abbe562b0@googlegroups.com> (raw)
In-Reply-To: <qihm04$h5a$1@dont-email.me>

On Friday, August 9, 2019 at 3:26:30 AM UTC+10, Jeffrey R. Carter wrote:
> On 8/8/19 5:40 PM, r......@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,

It still doesn't.

> so the above would create a new variable DO15I. I don't know what 
> flavor of FORTRAN was used in Mariner 1,

Marina 1 (1962) preceded FORTRAN 66.

> 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.

IMPLICIT NONE is an optional statement. If is is omitted,
variables do not need to be declared.

> 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,

If you read further on past the referenced article, you will see that
the looping DID go unnoticed. [try google]

> so I suspect this story is 
> apocryphal.

It wasn't.

> 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.

Single-character errors are still possible, whatever the language.

> 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.


  reply	other threads:[~2019-08-09  1:57 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   ` Mariner " Jeffrey R. Carter
2019-08-09  1:57     ` robin.vowels [this message]
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