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 X-Google-Thread: 103376,1ca6e1940d239274 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-19 17:04:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3BD0BFA2.EBF0690C@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Exactly the prblem, how do we make a known constant value static? References: <3BCDA15C.2976AF2@icn.siemens.de> <3BCDB1B0.52D3B04C@icn.siemens.de> <9qmbk4$jhb$1@newstoo.ericsson.se> <3BCF0D06.DD1D45F6@boeing.com> <9qp9ta$1pc$1@newstoo.ericsson.se> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 20 Oct 2001 00:04:27 GMT NNTP-Posting-Host: 12.86.34.149 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1003536267 12.86.34.149 (Sat, 20 Oct 2001 00:04:27 GMT) NNTP-Posting-Date: Sat, 20 Oct 2001 00:04:27 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:14946 Date: 2001-10-20T00:04:27+00:00 List-Id: Petter Fryklund wrote: > > Sure, my mistake. It would have been correct if we had been working on > bytes, but still, how do we make a rep spec? > > My_Array_Length : constant Integer := Integer ((Indices'Last - > Indices'First + 1) * 4 * 8); > > I'm not sure what Lutz meant by comment it out, it works, above. Wouldn't > that depend on the implementation? Lutz was saying to comment out the rep spec and simply pack the array. That would work. As far a portability, your solution is the one which depends upon implementation. You are assuming that an Integer is 32 bits. Using My_Array_Length := My_Array'Size is always poratable and correct. Remember that the Size attribute reports the number of BITS used for a type or object, unlike the "sizeof" operator in C and C++ that reports the number of "bytes" with the definition of "bytes" being implementation dependent. Jim Rogers Colorado Springs, Colorado USA