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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!ubc-cs!uw-beaver!zephyr.ens.tek.com!uunet!europa.asd.contel.com!wlbr!lonex.radc.af.mil!blackbird.afit.af.mil!dlindsle From: dlindsle@afit.af.mil (David T. Lindsley) Newsgroups: comp.lang.ada Subject: What should this do? Summary: Is this legal, or not? Keywords: Variable-length strings constraint exception Message-ID: <1991Jun28.193513.14271@afit.af.mil> Date: 28 Jun 91 19:35:13 GMT Organization: Air Force Institute of Technology List-Id: I have a question about dynamic strings. I was looking at a package on simtel20 that did the following: subtype INDEX is natural range 0..100; type DYN_STRING (SIZE : INDEX := 0) is private; -- private -- type DYN_STRING (size : index := 0) is -- record -- DATA : string (1..size); -- end record; the second declaration had a note to the effect of "uncomment and use this if you've got a VALIDATED compiler". Now as far as I can tell, during elaboration, a declaration of the form S : DYN_STRING; will result in the attempt to allocate an array constrained to (1..0), which should raise an exception. At least, that's what it does under VAX Ada, but not on Verdix. (Both generate warnings.) It seems to me this has to be a bug in one of the compilers. My question is: whose? Should this, or should it not, raise an exception? (The LRM references weren't any help.) -- Dave Lindsley #24601# OPINIONS. MINE. (Nobody tells me dlindsle@blackbird.afit.af.mil anything anyway, so I can't possibly ?? lamroN eb yhW ?? be anybody's mouthpiece...)