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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,269df2c167555fd6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-25 12:28:03 PST Path: supernews.google.com!sn-xit-03!supernews.com!news-feed.riddles.org.uk!nntp.cs.ubc.ca!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!enews.sgi.com!telocity-west!TELOCITY!newsrump.sjc.telocity.net!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada References: <3a95c52f@post.usenet.com> Subject: Re: Representation clause MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: X-Trace: NDAgTm9BdXRoVXNlciBURUxPQ0lUWS1SRUFERVJTIDIxNi4yMjcuNDcuNDkgIFN1biwgMjUgRmVi!IDIwMDEgMTI6MjI6NTggUFNU X-Abuse-Info: Please forward ALL headers when reporting abuse. X-Complaints-To: abuse@telocity.net NNTP-Posting-Date: Sun, 25 Feb 2001 12:22:58 PST Date: Sun, 25 Feb 2001 14:22:48 -0600 Xref: supernews.google.com comp.lang.ada:5523 Date: 2001-02-25T14:22:48-06:00 List-Id: The fact that a given compiler may do reasonable things when the sizes of the actual parameters of an instantiation of Ada.Unchecked_Conversion are unequal, is not a property on which I would like to depend. However, since there is at least one compiler for which my comment is not true, I have modified my comment to read as follows: -- The enumeration's 'Size attribute must be the same as that of -- the representation type, else the effect is implementation- -- defined; in particular, the result can be abnormal (see -- RM95 13.9.1). Now, of course, in the case of discontiguous representation, (the case for the example code) the result can still be abnormal for the Value function. Accordingly, the package client may either test the result with the 'Valid attribute, or opt to have an exception raised. "Ken Garlington" wrote in message news:FOPl6.864$Vz2.141381754@newssvr16.news.prodigy.com... > "David C. Hoos, Sr." wrote in message > news:fEOl6.129219$Ch.23956265@newsrump.sjc.telocity.net... > > : -- The enumeration's 'Size attribute must be the same as that of > : -- the representation type, else a compile error will occur when > : -- instantiating the generic package. > : for Colors'Size use Integer'Size; > > By the way: on GNAT 3.13p, the following will generate a compiler _warning_, > but will compile: > > for Colors'Size use 3; > > The test program also ran successfully. > > You may wish to modify the comments appropriately. > >