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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc7813b85b027ce5,start X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: 11.6 Date: 1999/11/20 Message-ID: <3836ff5b_1@news1.prserv.net>#1/1 X-Deja-AN: 551024129 Content-transfer-encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 20 Nov 1999 20:06:51 GMT, 32.101.8.71 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 1999-11-20T00:00:00+00:00 List-Id: Suppose we have a bounded stack: type Stack_Type (Size : Positive) is limited private; procedure Push (Stack : in out Stack_Type; Item : in Item_Type); private type Stack_Type (Size : Positive) is limited record Top : Natural := 0; Items : Item_Array (1 .. Size); end record; end Stacks; Now consider an implementation of Push: procedure Push (Stack : in out Stack_Type; Item : in Item_Type) is subtype Top_Range is Positive range 1 .. Stack.Size; Top : Natural renames Stack.Top; begin Top := Top_Range'(Top + 1); --??? Stack.Items (Top) := Item; end Push; Is it possible, because of 11.6 permissions, that the explicit range check in the marked line can be optimized away? Another question: if I compile this (or the instantiation?) with checks off, then will that cause the explicit range check to be omitted?