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,2317a992e7241939,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: GNAT won't link on "warning" Date: Mon, 29 Nov 2004 10:45:49 +0100 Organization: None Message-ID: <3664370.5jO7nDmgDP@linux1.krischik.com> Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1101721570 01 26249 BBD8XbnrihZkrHo 041129 09:46:10 X-Complaints-To: usenet-abuse@t-online.de To: GNAT Discussion List X-ID: Tla7UOZH8eeOanO9ujzGihYRarGBXt5YEd3vR4ovQS8sz+d8LEdmEw User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:6624 Date: 2004-11-29T10:45:49+01:00 List-Id: Hello, For demonstation purpose I wanted to write a program which will raise an exception on converting some data: with Ada.Text_IO; procedure Convert_Checked is type Short_Short_Integer is range -(2**7) .. +(2**7-1); type Byte is mod 2**8; package T_IO renames Ada.Text_IO; package M_IO is new Ada.Text_IO.Modular_IO (Byte); A : constant Short_Short_Integer := -1; B : constant Byte := Byte (A); begin T_IO.Put ("B = "); M_IO.Put ( Item => B, Width => 5, Base => 10); end Convert_Checked; When I compile the demo I get: convert_checked.adb:12:40: value not in range of type "Byte" defined at line 6 convert_checked.adb:12:40: static expression raises "Constraint_Error" It is my intention to use a value which is not in range of type "Byte" and "Constraint_Error" is precicly what I want to demonstate. However, GNAT won't link the program. Actually GNAT won't even create an *.o file. Is this right? Is there an option to force creation? With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com