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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!usc!ucsd!ucbvax!BOARDWALK.MITRE.ORG!howell From: howell@BOARDWALK.MITRE.ORG (Chuck Howell) Newsgroups: comp.lang.ada Subject: question re semantics of Ada length clause Message-ID: <9008042114.AA11484@boardwalk.mitre.org.mitre.org> Date: 4 Aug 90 21:14:37 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: I am unclear about (among many other things :-) the required semantics of part of 13.2 of the Ada LRM. Specifically, when an application uses a length clause to specify the collection size for an access type (13.2(b)), it's not clear to me that this is anything other than a "highwater mark" guide to the runtime. For example, an implementation that grabs sections of storage for collections from the heap on demand cannot a priori ensure that the requested amount of storage is available, correct? In that case, what is the implication of the phrase "specifies the number of storage units to be reserved for the collection"? If setting T'Storage_Size for an access type collection does not ensure that I won't get Storage_Error before I've used that many storage units for that collection at runtime, does it at least provide some check that what I've requested is potentially realizable? In other words, if I compile for Some_Access_Type'Storage_Size use 1; where 1 is not enough for even one allocation, should I get a warning that Storage_Error will be raised? If I compile for Some_Access_Type'Storage_Size use 1000000; where an attempt to actually allocate 1 Million storage units would raise Storage_Error, should I expect a warning? Neither VADS nor DEC ACS give compile warnings in either situation. Since there is no explicit requirement in the Ada LRM for compilers to provide such warnings for the use of 'Storage_Size, what does this particular length clause provide? Just some "informative" guidance to the compiler? Thanks for any insight provided, Chuck +------------------------------------------------------------------------+ | Chuck Howell, M/S Z645 INTERNET: howell@community-chest.mitre.org | | The MITRE Corporation OR howell@mwunix.mitre.org | | 7525 Colshire Drive | | McLean VA 22102-3481 FAX: (703) 883-5519 | +------------------------------------------------------------------------+