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,d09a657d9ceb7264,start X-Google-Attributes: gid103376,public From: "W. Wesley Groleau (Wes)" Subject: Alternative for AQS-95 para. 5.6.6 Date: 1996/04/04 Message-ID: <9604041602.AA04748@most>#1/1 X-Deja-AN: 145827669 sender: Ada programming language comments: cc: ausnit@software.org mailer: Elm [revision: 70.85] newsgroups: comp.lang.ada Date: 1996-04-04T00:00:00+00:00 List-Id: Ada 95 Quality and Style carries forward the AQS-83 recommendation for a safety check to prevent runaway looping or recursion. The suggestion is based on a counter and a limit check. For real-time or safety critical systems, a time limit may be more useful than a count. Is there any detail I've missed that would prevent using the following technique? select delay Message_Interval * 0.75; raise Processing_Took_Too_Long; then abort loop |or| Recursive_Subprogram; end loop; | | end select; For Ada 83, please critique this: Runaway.Start_Checking ( Check_ID => Local_Check, -- initializes ID which Time_Limit => ); -- contains discriminant Iter_Limit => ); -- set by choice of start [ while xxx | for xxx ] loop Runaway.Check ( Local_Check ); -- raises Too_Much_Time or Too_Many_Times Actual package Runaway is trivial to implement (and these are not my original names). But I'm not sure it's worth the time. I had already done the spec, but the file seems to have Run Away :-) The above is not any easier than the AQS approach, but it does have the advantage of standardizing the technique for a whole project. I know I can count on c.l.a for plenty of useful feedback (and probably a flame or two). -- --------------------------------------------------------------------------- W. Wesley Groleau (Wes) Office: 219-429-4923 Magnavox - Mail Stop 10-40 Home: 219-471-7206 Fort Wayne, IN 46808 elm (Unix): wwgrol@pseserv3.fw.hac.com ---------------------------------------------------------------------------