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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ec21c3c7cdc7ff3e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.uni-stuttgart.de!carbon.eu.sun.com!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: Martin Dowie Newsgroups: comp.lang.ada Subject: Re: private types Date: Sat, 18 Mar 2006 12:06:37 +0000 (UTC) Organization: BT Openworld Message-ID: References: <1142279908.327131.230200@j52g2000cwj.googlegroups.com> NNTP-Posting-Host: host86-131-205-164.range86-131.btcentralplus.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com 1142683597 2928 86.131.205.164 (18 Mar 2006 12:06:37 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Sat, 18 Mar 2006 12:06:37 +0000 (UTC) In-Reply-To: User-Agent: Thunderbird 1.5 (Windows/20051201) Xref: g2news1.google.com comp.lang.ada:3428 Date: 2006-03-18T12:06:37+00:00 List-Id: Randy Brukardt wrote: > It's not just testing. Ada 95 is very clear that an Ada compiler cannot > assume an object is in range unless it can prove it is initialized. Explicit > initialization makes this proof trivial (and leaving it out may make it > impossible to prove.) Thus, given > A : Positive := 10; > B : Positive; > the compiler can assume that A is in range, potentially being able to > eliminate checks and speeding up the code. But it cannot assume that B is in > range (unless it can prove that it is initialized further on). > > So I recommend initalizing everything (or assigning it immediately after the > begin) that could be significant to performance. Or use a tool like PolySpace, which is very good at spotting this sort of thing. (www.polyspace.com). Cheers -- Martin