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,939bba6defed3e0d,start X-Google-Attributes: gid103376,public From: arnold.steve@ensco.com (Steve Arnold) Subject: problem solved, but I don't know why (was: GNAT implementation bug) Date: 2000/04/14 Message-ID: <8d7n1a$ee6@journal.concentric.net>#1/1 X-Deja-AN: 611209243 Organization: ENSCO, Inc. Newsgroups: comp.lang.ada Date: 2000-04-14T00:00:00+00:00 List-Id: It looks like I solved the problem, but I still have no idea why there was a problem in the first place (being a newbie, it seems like it *should've* worked). When I replaced the following (in Remove): if List.Count = 1 then Clear(List) ; elsif List.Cursor = List.Head then... with the actual code from Clear: if List.Count = 1 then List := (Count => 0, Traversing => False, others => null) ; elsif List.Cursor = List.Head then... it started working correctly. But I still have at least two questions (on this particular issue, anyway ;) 1) Why did this code behave differently when running under Linux than when running under windoze? (obvious answer: windoze is brain-dead) 2) Why did my trivial change fix it? In other parts of these packages, I call functions/procedures that were defined in the same package, and it always worked. For example, I do this: begin -- Remove if List.Count = 0 then Ada.Exceptions.Raise_Exception (Cursor_Error'identity,... which should always work. But I also do this (which seems more readable to me): elsif Empty(List) then Ada.Exceptions.Raise_Exception (Cursor_Error'identity,... where function Empty is in the same package as Remove, Clear, etc, and this also works (at least it seems to). Am I doing something wrong? Is there only a potential problem doing this when the called function/procedure is manipulating pointers? Just what is going on here? When is it safe to do this (if ever) and when is it not safe?