comp.lang.ada
 help / color / mirror / Atom feed
* question re semantics of Ada length clause
@ 1990-08-04 21:14 Chuck Howell
  1990-08-05 20:44 ` Vinod Grover
  1990-08-06 13:30 ` John Goodenough
  0 siblings, 2 replies; 3+ messages in thread
From: Chuck Howell @ 1990-08-04 21:14 UTC (permalink / 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                    |
+------------------------------------------------------------------------+

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1990-08-06 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1990-08-04 21:14 question re semantics of Ada length clause Chuck Howell
1990-08-05 20:44 ` Vinod Grover
1990-08-06 13:30 ` John Goodenough

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