comp.lang.ada
 help / color / mirror / Atom feed
From: pfk@schnecke.offl.uni-jena.de (Frank Klemm)
Subject: Re: Ariane 5 failure (Was: Size code Ada and C)
Date: 1998/07/10
Date: 1998-07-10T00:00:00+00:00	[thread overview]
Message-ID: <slrn6qcki5.11e.pfk@schnecke.offl.uni-jena.de> (raw)
In-Reply-To: 6o4is0$ji5@gcsin3.geccs.gecm.com

On 10 Jul 1998 08:20:16 GMT, John McCabe <john@assen.demon.co.uk> wrote:
>Dale Stanbrough <dale@goanna.cs.rmit.edu.au> wrote:
>>"You can always disable range checking in Ada, but was this the idea of
>>Ada ???"
>
>>The idea in Ada is that it gives you _more_ freedom than C. You have the 
>>freedom to check or not to check.
>
>>The only option you have with C is to accept array index overflows, and
>>try and find them in the debugger.
>
>And then what? Put in checks manually that you could have done in the 
>first place? As this would be an alternative option, your suggestion 
>being the only option is not quite true.
>
Manually checks are *NO* checks. For those who can read C:

double x[1000];

void sinusize(double *p, size_t len)
  {
    while (len--)
      *p = sin (*p), p++;
  }


main(...)
  {
    sinusize(x, sizeof(x));
    
    return 0;
  }

Array address and length are stored independendly, i.e. it is *very* easy to make
errors in the range checking. An array must be more than a pointer to enable range checking,
C can't do this.

-- 
Frank Klemm

 /------\  /-----------------------------------------------------\
| eMail: || pfk@uni-jena.de | home: pfk@schnecke.offl.uni-jena.de |
| Tel:   ||                 | home: +49 (3641) 390545             |
| sMail: ||  Frank Klemm, Ziegesarstr. 1, D-07747 Jena, Germany   |
 \------/  \-----------------------------------------------------/




  reply	other threads:[~1998-07-10  0:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <35921271.E51E36DF@aonix.fr>
     [not found] ` <3598358A.73FF35CC@pipeline.com>
     [not found]   ` <dewar.899298949@merv>
1998-07-03  0:00     ` Performance Ada and C, was Re: Size code Ada and C Van Snyder
1998-07-03  0:00       ` Performance " Markus Kuhn
1998-07-03  0:00         ` Robert Dewar
1998-07-03  0:00           ` Markus Kuhn
1998-07-04  0:00             ` ak
1998-07-07  0:00             ` Frank Klemm
1998-07-13  0:00               ` Daren Scot Wilson
     [not found] ` <m3zpf1tyr8.fsf@zaphod.enst.fr>
     [not found]   ` <6mtiv0$9j3@gcsin3.geccs.gecm.com>
     [not found]     ` <dewar.898962846@merv>
     [not found]       ` <6n8393$hoi$2@platane.wanadoo.fr>
     [not found]         ` <6n84im$79q@gcsin3.geccs.gecm.com>
     [not found]           ` <m3u35470ds.fsf@zaphod.enst.fr>
     [not found]             ` <6n8b7u$9hm@gcsin3.geccs.gecm.com>
     [not found]               ` <m3vhpk5f0d.fsf@zaphod.enst.fr>
     [not found]                 ` <3597db2d.1017430@news.demon.co.uk>
     [not found]                   ` <EACHUS.98Jun30173656@spectre.mitre.org>
1998-07-03  0:00                     ` Size code " John McCabe
1998-07-03  0:00                       ` Larry Elmore
1998-07-03  0:00                         ` John McCabe
1998-07-07  0:00                         ` Robert I. Eachus
     [not found]         ` <dewar.899298821@merv>
1998-07-07  0:00           ` Robert I. Eachus
     [not found]       ` <6n7jut$al0$1@nnrp1.dejanews.com>
     [not found]         ` <6navqt$shc$1@goanna.cs.rmit.edu.au>
     [not found]           ` <359A53E2.41C6@lanl.gov>
     [not found]             ` <dewar.899334821@merv>
     [not found]               ` <6nfp0v$dgl@gcsin3.geccs.gecm.com>
1998-07-02  0:00                 ` Ariane 5 failure (Was: Size code Ada and C) Jean-Pierre Rosen
1998-07-03  0:00             ` robin
1998-07-02  0:00               ` William Clodius
1998-07-09  0:00             ` Plenty of unnecessary contraint tests " Frank Klemm
1998-07-09  0:00               ` Robert Dewar
1998-07-10  0:00                 ` Frank Klemm
1998-07-10  0:00               ` Robert S. White
1998-07-10  0:00               ` Ariane 5 failure " Dale Stanbrough
1998-07-10  0:00                 ` John McCabe
1998-07-10  0:00                   ` Frank Klemm [this message]
1998-07-10  0:00                   ` Pat Rogers
replies disabled

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