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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c615e41a65104004 X-Google-Attributes: gid103376,public From: pfk@schnecke.offl.uni-jena.de (Frank Klemm) Subject: Re: Ariane 5 failure (Was: Size code Ada and C) Date: 1998/07/10 Message-ID: #1/1 X-Deja-AN: 370324906 X-Nntp-Posting-Host: schnecke.offl.uni-jena.de Sender: news@fsuj50.rz.uni-jena.de (News System) References: <6navqt$shc$1@goanna.cs.rmit.edu.au> <6o3sid$qn9$1@goanna.cs.rmit.edu.au> <6o4is0$ji5@gcsin3.geccs.gecm.com> Organization: Pbzchgre fvaq hasruyone, Qnir Newsgroups: comp.lang.ada Date: 1998-07-10T00:00:00+00:00 List-Id: On 10 Jul 1998 08:20:16 GMT, John McCabe wrote: >Dale Stanbrough 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 | \------/ \-----------------------------------------------------/