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,74b55538385b7366 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Ada safety road Was: Which is right ... Date: 1999/06/09 Message-ID: <375E9592.32DA0709@averstar.com>#1/1 X-Deja-AN: 487546475 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <928083159.436.79@news.remarQ.com> <928174549.336.98@news.remarQ.com> <7iuqkc$ln6$1@nnrp1.deja.com> <928529202.956.79@news.remarQ.com> <928569312.951.42@news.remarQ.com> <7jb1l9$694$1@nnrp1.deja.com> <928703068.617.98@news.remarQ.com> <1999Jun6.181633.1@eisner> <7jlg6l$g6d$1@nnrp1.deja.com> Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-06-09T00:00:00+00:00 List-Id: Robert Dewar wrote: > > In article , > Keith Thompson wrote: > > This is why the authors of Ada (both 83 and 95) made such an > > effort to minimize the number of cases where this can happen, > > and to clearly document the cases that couldn't reasonably be > > avoided. > > I think more could have been done, particularly in the area > of uninitialized variables. Using an uninitialized variable is *not* erroneous in Ada 95. > ... For simple variables, I like the > CDL approach which says that there must not exist any static > paths through the program allowing a simple variable to be > undefined (i.e. no ud chain can reach from a reference to a > declaration with no initialization). This worked very well > in CDL in practice (CDL = Koster's Compiler Definition > Language). I presume that Ada 95 compilers that try to properly avoid unpredictable behavior when an uninitialized variable is used do this kind of tracking to determine whether the variable *might* be uninitialized, and hence might be outside its declared range. Both GNAT and AdaMagic-based Ada 95 compilers seem to produce "uninitialized variable" warnings these days. At least in the AdaMagic-based compilers, that information is used to "bound" possible errors associated with using uninitialized variables, to avoid the dreaded erroneous/nose-demon situation. -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA