comp.lang.ada
 help / color / mirror / Atom feed
From: howell@BOARDWALK.MITRE.ORG (Chuck Howell)
Subject: question re semantics of Ada length clause
Date: 4 Aug 90 21:14:37 GMT	[thread overview]
Message-ID: <9008042114.AA11484@boardwalk.mitre.org.mitre.org> (raw)

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                    |
+------------------------------------------------------------------------+

             reply	other threads:[~1990-08-04 21:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-08-04 21:14 Chuck Howell [this message]
1990-08-05 20:44 ` question re semantics of Ada length clause Vinod Grover
1990-08-06 13:30 ` John Goodenough
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox