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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.137.8 with SMTP id qe8mr6281222pab.46.1393517217787; Thu, 27 Feb 2014 08:06:57 -0800 (PST) X-Received: by 10.50.1.180 with SMTP id 20mr118706ign.9.1393517217521; Thu, 27 Feb 2014 08:06:57 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!uq10no1579020igb.0!news-out.google.com!gi6ni1igc.0!nntp.google.com!uq10no1579004igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 27 Feb 2014 08:06:57 -0800 (PST) In-Reply-To: <376f729d-2883-4b28-82fa-9a24420e5e6e@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: <376f729d-2883-4b28-82fa-9a24420e5e6e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: subtype of System.Address type From: adambeneschan@gmail.com Injection-Date: Thu, 27 Feb 2014 16:06:57 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:18764 Date: 2014-02-27T08:06:57-08:00 List-Id: On Wednesday, February 26, 2014 9:19:57 PM UTC-8, ashwath...@gmail.com wrot= e: > Hello, >=20 > My compiler(GNAT 3.1 ) gives an error for the following statement. >=20 >=20 >=20 > =A0subtype MEMORY_RANGE_TYPE is SYSTEM.ADDRESS range 16#0000_0000#..16#7F= FF_FFFF#;=20 >=20 > It says incorrect constraint for this type. >=20 > Kindly let me know the mistake I am doing. Like everyone else said, System.Address is a private type. If you really n= eed to use integers as addresses, use System.Storage_Elements.Integer_Addre= ss: subtype Memory_Range_Type is System.Storage_Elements.Integer_Address ran= ge 16#0000_0000# .. 16#7FFF_FFFF#; Integer_Address is required to be either a signed or modular integer subtyp= e; either way, the above will work as long as both 0 and 7FFFFFFF are in ra= nge for the implementation-defined subtype. Then, System.Storage_Elements.= To_Address(Value) will convert an Integer_Address to a System.Address. See= RM 13.7.1. (This package has been part of the language since Ada 95.)