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-18 11:13:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed1.bredband.com!bredband!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Concatenation and Characters Date: Fri, 18 Oct 2002 18:13:06 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <44hp9.807$_u6.205@nwrddc01.gnilink.net> <3DA5AE5F.3030902@attbi.com> <3DB03EF1.EE771923@mmm.com> NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1034964786 15659 129.241.83.78 (18 Oct 2002 18:13:06 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Fri, 18 Oct 2002 18:13:06 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:29914 Date: 2002-10-18T18:13:06+00:00 List-Id: Programmer Dude wrote: > Mark Biggar wrote: > >> Becasue evaluating an uninitialized variable is only a bounded error, >> which is handled at run-time. > > I'm new to, and just beginning to explore, Ada. It surprised me that > Ada allows evalutation of an uninitialized variable without saying > *something* about it during compile. > > Surely I'm missing something? Here is an example: 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; Compiling it with GNAT: gnatmake uninit.adb gnatgcc -c uninit.adb uninit.adb:4:04: warning: "A" is never assigned a value gnatbind -x uninit.ali gnatlink uninit.ali You can also compile with the -gnatwe flag which treats all warnings as errors. Regards, Preben -- This is Ada land. On quiet nights you can hear C programmers debug.