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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ae9506fd4dcf7090 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-21 14:00:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!cyclone1.gnilink.net!newsfeed.news2me.com!news-out.visi.com!hermes.visi.com!news From: cjsonnack@mmm.com (Programmer Dude) Newsgroups: comp.lang.ada Subject: Re: Concatenation and Characters Date: Mon, 21 Oct 2002 15:42:51 -0500 Organization: 3M Company Message-ID: <3DB466CB.7CE0BC59@mmm.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5 [en]C-CCK-MCD 3M/NCP 4.5 (WinNT; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:30009 Date: 2002-10-21T15:42:51-05:00 List-Id: Jim Rogers 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. Oh, I agree completely. I have--where possible--my compilers set to treat warnings as errors when compiling for release. But is this *required* behavior or QOI behavior? Some of the posts seem to suggest this is not required by the language spec, and THAT'S what I'm finding slightly surprising. I guess I'm wondering what behavior the language requires. If it is required that uninitialized variables never be evaluated, I can see an implementation choosing not to attempt to diagnose this at compile time and using another mechanism to detect it at run-time (such as special values or descriptor bits or whatever). Upthread Preben Randhol wrote this: | with Ada.Text_IO; use Ada.Text_IO; | | procedure uninit is | A : Integer; | B : Integer := 2; | begin | | if A > B then | Put_Line ("A is greater than B"); | else | Put_Line ("B is greater than A"); | end if; | end uninit; Maybe my question is best stated thus: is there any correct implentation of Ada that would allow this code to run? -- |_ CJSonnack _____________| How's my programming? | |_ http://www.Sonnack.com/ ___________________| Call: 1-800-DEV-NULL | |_____________________________________________|_______________________| Opinions expressed herein are my own and may not represent those of my employer.