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-Thread: 103376,58331d88725b914e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newscon02.news.prodigy.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: for Object_Size use 0 Date: 14 Apr 2005 10:48:15 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1113490095 26978 192.74.137.71 (14 Apr 2005 14:48:15 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 14 Apr 2005 14:48:15 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:10461 Date: 2005-04-14T10:48:15-04:00 List-Id: Christoph Grein writes: > Robert A Duff wrote: > > > "Robert C. Leif" writes: > > > > > >> I specifically need to know if it is possible to create a zero > >> sized > >> type in Ada 95 or the updated standard, which is to be released in > >> the near > >> future. > > > > For a discrete type, Size can be zero. So in your example: > > > > type Empty_Type is (Empty); > > > > Empty_Type'Size must be zero (if there is no Size clause). > > This follows from RM-13.3(55). The same is true of > > "subtype S is Integer range 0..0;" -- S'Size = 0 by default. > > See also para 55.b in the AARM. > > > But this is only "Implementation Advice". Consequently RM-13.3(55) uses > the word "should". Yes, but C.2(2) turns that Advice into hard requirements. So any compiler that claims to support Annex C (which GNAT does) must obey that advice. So what I said is not entirely correct, since an implementation need not support Annex C. But in practise, what I said is true, since pretty much all Ada implementations (claim to) support this Annex. Anyway, even for Implementation Advice that is not covered by C.2, implementations really ought to obey, unless they have good reason not to. So it's often legitimate to complain to your compiler vendor if they don't obey Advice. In retrospect, I think perhaps we should not have called it "Implementation Advice". Perhaps "Informal Rules" or "Untestable Requirements" would be better. Most of these really ought to be language rules; it's just that there's no way to formalize them, and therefore no way to test them in an ACATS-style test suite. > But you're the language lawyer... ;-) ...which is why I know about C.2. - Bob