From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 12 Aug 91 19:39:00 GMT From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!bu.edu!inmet!stt@ucbvax. Berkeley.EDU Subject: Re: Help with VAX/VMS Ada Message-ID: <20600114@inmet> List-Id: > Re: Help with VAX/VMS Ada by UN025523@WVNVAXA.WVNET.EDU > type Vector (Lower_Bound, Upper_Bound : Integer := 0) is > record > The_Vector : Vector_Array (Lower_Bound .. Upper_Bound) > := (others => Zero); > end record; By providing a default for all discriminants, you are allowing the declaration of unconstrained instances of Vector. E.g., the following would now be legal: X : Vector; In this situation, most Ada compilers will allocate space sufficient to hold the largest possible value. In this case, the largest value is truly enormous, because the range of the discriminants is Integer. The message from the compiler indicates that a CONSTRAINT_ERROR is likely when computing this size of this largest value. To avoid this problem, define an appropriate subtype of Integer which provides a reasonable upper bound on the range of indices for your vector. E.g.: subtype Vector_Index_Range is Integer range 0..100; type Vector(LB, UB : Vector_Index_Range := 0) is ... Now, the largest value is when LB = 0 and UB = 100. This value is of reasonable size. S. Tucker Taft stt@inmet.inmet.com Intermetrics, Inc. Cambridge, MA 02138