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: 9 Apr 92 20:53:05 GMT From: wdl39!mab@ford-wdl1.arpa (Mark A Biggar) Subject: Re: 'IMAGE Message-ID: <1992Apr9.205305.2003@wdl.loral.com> List-Id: In article <1714@nic.cerf.net> sss@nic.cerf.net (Marlene M. Eckert) writes: >Hello. >Should the following 'image of an uninitialized >enumeration type raise CONSTRAINT_ERROR? >In similar situations our compiler has printed all >blanks, garbage, and even readable garbage. Of >course, the answer is probably in the LRM somewhere... >--------------------------------------------------------- >with Text_IO; use Text_IO; >procedure Image is >type Colors is (Red, Green, Blue); >My_Color : Colors; -- Not initialized! >begin > Put_Line(Colors'image(My_Color)); -- Legal? >end Image; Using an undefined value like that makes your program erronious and it can do anything it damn well pleases, i.e., raise CONSTRAINT_ERROR, Crash the CPU, Erase your hard disk, even as someone put it in comp.std.c in a similar discussion cause miniture deamons to blow out your nose! There has been quite a lot of discussion about this in the Ada9X reviewers group and Ada9x may well contain something that tightens this up to at least a bounded error (the program is still in error, it is not required that the error be detected, but the set of allowed actions is finite and specified by the standard.) -- Mark Biggar mab@wdl1.wdl.loral.com