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=-0.9 required=5.0 tests=BAYES_00,FROM_NUMERIC_TLD autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ae9506fd4dcf7090 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-22 02:26:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uunet!sea.uu.net!sac.uu.net!ash.uu.net!lore.csc.com!baen1673807.greenlnk.net!baen1673807!not-for-mail From: Stuart Palin Newsgroups: comp.lang.ada Subject: Re: Concatenation and Characters Date: Tue, 22 Oct 2002 09:51:14 +0100 Organization: BAE SYSTEMS Avionics Message-ID: <3DB51182.BEBB0051@0.0> References: <44hp9.807$_u6.205@nwrddc01.gnilink.net> <3DA5AE5F.3030902@attbi.com> <3DB03EF1.EE771923@mmm.com> <3DB43EB0.AAF4B38C@mmm.com> <3DB44B9C.80007@worldnet.att.net> NNTP-Posting-Host: 20.44.240.3 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: lore.csc.com 1035278763 25080 20.44.240.3 (22 Oct 2002 09:26:03 GMT) X-Complaints-To: abuse@news.csc.com NNTP-Posting-Date: Tue, 22 Oct 2002 09:26:03 +0000 (UTC) X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en X-Original-NNTP-Posting-Host: rc2966.rochstr.gmav.gecm.com X-Original-Trace: 22 Oct 2002 09:51:00 +0100, rc2966.rochstr.gmav.gecm.com Xref: archiver1.google.com comp.lang.ada:30020 Date: 2002-10-22T09:51:14+01:00 List-Id: Jim Rogers wrote: > > Programmer Dude wrote: > > > > So, bottom line from the answers I've read is that Ada (the language) > > allows uninitialized variables to be used which *may* (must?) require > > a run-time exception.... but what if the random value in the variable > > isn't a contraint violation? Does that mean an uninitialized variable > > *could* be taken seriously and never detected as having a random bit > > pattern? > > > > If the compiler detects that you are attempting to use an uninitialized > value it will issue a diagnostic message. It is never a good thing to > release a program without first addressing and eliminating all compiler > diagnostic messages. It is my experience that compilers only tend to give such warnings where the use of the uninitialized value is unconditional. Usually, where a variable may be uninitialized under some conditions the compiler 'assumes' the programmer knows what they are doing and does not give a warning. If you want the full set of warnings you need to consider using tools such as SPARK (or possibly/probably) some of the Abstract Interpretation analysis tools such as Polyspace Verifier. The matter of Initialization is one given considerable attention in SPARK. In response to Programmer Dude's comments: Ada is not a 'safe' language (whatever that may mean). It does a number of trade-offs between supporting 'safety enhancing' concepts and reasonably efficient implementation. Initialization of variables is one of these trade-offs. SPARK uses Ada as a basis, but takes the issues of demonstrating safety-enhancing features (such as correctness of data flow) much further. But it is worth noting that it can not (always) do this within the scope of the Ada language; which is why, in addition to sub-setting the language, it requires annotations to add information about the [intended] behaviour of the software. If you are unfamiliar with SPARK, check out www.sparkada.com. -- Stuart Palin [usual disclaimers]