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,3b322104ceea062d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news.glorb.com!wns13feed!worldnet.att.net!attbi_s22.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: What does -gnato do? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.176 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s22 1156643507 12.201.97.176 (Sun, 27 Aug 2006 01:51:47 GMT) NNTP-Posting-Date: Sun, 27 Aug 2006 01:51:47 GMT Date: Sun, 27 Aug 2006 01:51:47 GMT Xref: g2news2.google.com comp.lang.ada:6404 Date: 2006-08-27T01:51:47+00:00 List-Id: Peter C. Chapin wrote: > > with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; > procedure Check is > X : Integer := Integer'Last; > begin > X := X + 1; > Put(X); > end Check; > > When I build this program *without* the -gnato option I get the > following warning: > > check.adb:6:11: warning: value not in range of type "Standard.Integer" > check.adb:6:11: warning: "Constraint_Error" will be raised at run time It's apparent that the compiler has calculated the result of the addition in order to issue this warning. It may then have replaced the assignment by "raise Constraint_Error;". Make the value of X dynamic and see if -gnato makes a difference: X : Integer := Integer'Value (Ada.Command_Line.Argument (1) ); -- Jeff Carter "Sheriff murdered, crops burned, stores looted, people stampeded, and cattle raped." Blazing Saddles 35