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 X-Google-Thread: 103376,13ab88b30e0f779d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-28 09:30:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!peernews3.colt.net!news0.de.colt.net!blackbush.xlink.net!blackbush.de.kpnqwest.net!news.erfurt.igrz.de!drcomp.erfurt.thur.de!not-for-mail From: Adrian Knoth Newsgroups: comp.lang.ada Subject: Re: Efficient Matrix? Date: 28 Dec 2002 17:19:40 GMT Organization: Modern Electronics Message-ID: References: <3e0b2a66_4@news.bluewin.ch> NNTP-Posting-Host: drcomp.erfurt.thur.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Server-Date: 28 Dec 2002 17:19:40 GMT User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:32363 Date: 2002-12-28T17:19:40+00:00 List-Id: Robert A Duff wrote: >> > Compilers are required to pack tightly in this case (one bit per Boolean >> > component). I.e., Matrix'Component_Size will be 1 if there's a pragma >> > Pack. See RM-13.2(9). >> Hmm? > Looks like a compiler bug to me. Not really. 9 For a packed array type, if the component subtype's Size is less than or equal to the word size, and Component_Size is not specified for the type, Component_Size should be less than or equal to the Size of the component subtype, rounded up to the nearest factor of the word size. "should be less than or equal", so gnat is RM-conformable here, but the important question is why the representation-clause is not respected. I guess, the answer is in RM-13.1(21): 22 An implementation need not support representation items containing nonstatic expressions, except that an implementation should support a representation item for a given entity if each nonstatic expression in the representation item is a name that statically denotes a constant declared before the entity. 23 An implementation need not support a specification for the Size for a given composite subtype, nor the size or storage place for an object (including a component) of a given composite subtype, unless the constraints on the subtype and its composite subcomponents (if any) are all static constraints. And it looks like that "Positive range <>" is not static. In fact, it is unconstrained. > It seems to me that RM-13.2(9) implies packed arrays of Boolean have > 'Component_Size = 1. Don't you think so? No. For static arrays this would be right because 1 bit f�r Boolean is smallest packing. This will happen if you say something like type static_array is (1 .. 64) of Boolean; pragma Pack (static_array); which should return static_array'Size=64, implying Component_Size=1. But the other paragraphs in Section 13 permit the compiler to neglect all nonstatic expressions. >> adi@drcomp:/tmp$ ./bla >> 8 >> 8 >> adi@drcomp:/tmp$ > So what size is A.all? 10000*5000*8 bits. -- mail: adi@thur.de http://adi.thur.de PGP: v2-key via keyserver Ausgerottet ist die Pest, das macht doch nichts, es gibt doch West.