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,13ab88b30e0f779d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-28 15:43:09 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: Efficient Matrix? User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Sat, 28 Dec 2002 23:42:33 GMT Content-Type: text/plain; charset=us-ascii References: <3e0b2a66_4@news.bluewin.ch> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Organization: The World Public Access UNIX, Brookline, MA Xref: archiver1.google.com comp.lang.ada:32373 Date: 2002-12-28T23:42:33+00:00 List-Id: Adrian Knoth writes: > Robert A Duff wrote: > > > turns it into a binding requirement. 13.1(20) also mentions this. > > ACK. > > > So a standards conforming compiler can get away without supporting any > > representation items at all. But a compiler that claims to support the > > SP annex must obey 13.2(9). > > 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. > > How does this _forces_ a compiler to set a packed boolean array's > Component_Size to 1? As I understand the paragraph it determines > the compiler's behaviour if the Component_Size of a packed array is > _not_ defined by the user. I guess I was talking about that case. E.g: type T is array (Positive range <>) of Boolean; pragma Pack(T); The component subtype is Boolean. Boolean'Size = 1, by 13.3(49). Also 13.3(55), combined with the SP annex thing. This size (1 bit) is <= word size on every machine. And it's a factor of the word size on every machine. So the compiler must choose T'Component_Size <= 1. And it can't very well choose < 1, so it must choose = 1. If you specify T'Component_Size, then the above paragraph is saying that overrides the pragma. So if you say: type T is array (Positive range <>) of Boolean; pragma Pack(T); for T'Component_Size use 2; then T'Component_Size = 2. This is required to be supported by 13.3(73), combined with the SP annex thing, assuming the word size is an even number of bits (which is quite common ;-)). > I guess I'll send a bug-report. Unfortunately the gcc-bug-database is > write-only at the moment, so to say, there seems to be nobody carrying > much about ProblemReports. Unless you're a paying customer, they have no obligation to fix things soon. But they do seem to fix things "eventually". - Bob