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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b2923d60cb81694b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!p10g2000cwp.googlegroups.com!not-for-mail From: "frikk" Newsgroups: comp.lang.ada Subject: Re: Unsigned Integer Restraint Errors Date: 12 Mar 2007 13:00:31 -0700 Organization: http://groups.google.com Message-ID: <1173729631.777149.209370@p10g2000cwp.googlegroups.com> References: <1173712032.183064.264340@8g2000cwh.googlegroups.com> <1173720219.194301.327140@c51g2000cwc.googlegroups.com> <1173723067.887249.88160@n33g2000cwc.googlegroups.com> NNTP-Posting-Host: 12.129.98.129 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1173729637 4255 127.0.0.1 (12 Mar 2007 20:00:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 12 Mar 2007 20:00:37 +0000 (UTC) In-Reply-To: <1173723067.887249.88160@n33g2000cwc.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 TRY0PX01 Complaints-To: groups-abuse@google.com Injection-Info: p10g2000cwp.googlegroups.com; posting-host=12.129.98.129; posting-account=192wHg0AAAAzciSzoZsEBI9bw5pVCopO Xref: g2news1.google.com comp.lang.ada:14492 Date: 2007-03-12T13:00:31-07:00 List-Id: On Mar 12, 2:11 pm, "frikk" wrote: > On Mar 12, 1:23 pm, "Adam Beneschan" wrote: > > > On Mar 12, 8:07 am, "frikk" wrote: > > > > LASTLY: > > > Please note that when I change the range value from 0 .. 5 to 0 .. > > > 2**64-1, or 0 .. UNSIGNED_LONG_INT'Last, there is no constraint error > > > raised. This is the same behavior as the first example. > > > I missed this question the first time. > > [...] > > > -- Adam > > Thanks for the answers Adam. What you've said about the '-' makes > sense. I'll look into this. > > The deal about how the constraint error being raised is outside the > scope of the procedure makes sense as well. I'll update my code to > reflect this. > > So if I compile with gnato - should this fix my constraint error > raising? Basically I just need to be able to detect if the input is > outside the range - without using something like "if x < 0 or x > > 2**64 then" ... > > Thank you everyone! > Blaine As it turns out, the example that I've posted works just fine when I use command line arguments: b := UNSIGNED_LONG_INT'VALUE(Argument(2)); The constraint is thrown perfectly. I do this inside the procedure, of course, not in the declarations. Interesting eh? Blaine