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 Path: g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!cyclone1.gnilink.net!gnilink.net!wns13feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: float confusion References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 173.16.158.68 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1247613792 173.16.158.68 (Tue, 14 Jul 2009 23:23:12 GMT) NNTP-Posting-Date: Tue, 14 Jul 2009 23:23:12 GMT Organization: AT&T ASP.att.net Date: Tue, 14 Jul 2009 23:23:12 GMT Xref: g2news2.google.com comp.lang.ada:7060 Date: 2009-07-14T23:23:12+00:00 List-Id: Rob Solomon wrote: > I ran this simple example thru GNAT and I'm confused by the result. Did you use the -gnato (integer overflow checking) and -fstack-check switches? GNAT is not an Ada compiler without them. > -- integer type does not raise overflow constraint_error > -- natural and positive types do raise overflow constraint_error when > -- overflow is by multiplication, but not by addition. Note that there is a difference between an overflow check and a range check. Natural and Positive (which are subtypes, not types) have range constraints that Integer does not; GNAT performs range checks even when overflow checks are not enabled. > card32_IO.put(u2); These appear to be undefined. What output do you expect from the program, and what do you get? -- Jeff Carter "Whatever it is, I'm against it." Horse Feathers 46