comp.lang.ada
 help / color / mirror / Atom feed
From: wdl39!mab@ford-wdl1.arpa  (Mark A Biggar)
Subject: Re: 'IMAGE
Date: 9 Apr 92 20:53:05 GMT	[thread overview]
Message-ID: <1992Apr9.205305.2003@wdl.loral.com> (raw)

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

             reply	other threads:[~1992-04-09 20:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-04-09 20:53 Mark A Biggar [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-10  9:30 What exactly is the licensing situation with Gnat? Hubert
2014-11-10 11:09 ` What exactly is the licensing situation with GNAT? Hubert
2014-11-10 11:19   ` Markus Schöpflin
2014-11-10 15:45     ` David Botton
2014-11-11  0:09       ` Hubert
2014-11-11 13:37         ` john
2014-11-11 22:52           ` Hubert
2014-11-11 23:10             ` David Botton
2014-11-11 23:25               ` Alan Jump
2014-11-12  0:50                 ` David Botton
2014-11-12  1:15                   ` Hubert
2014-11-12  1:24                     ` David Botton
2014-11-12  8:12                       ` Simon Wright
2014-11-12  8:35                         ` Hubert
2014-11-12  9:25                           ` Mark Carroll
2014-11-12  9:37                             ` Hubert
2014-11-12 10:31                               ` jm.tarrasa
2014-11-12 10:44                                 ` Hubert
2014-11-12 22:53                                   ` Randy Brukardt
2014-11-12 23:21                                     ` David Botton
2014-11-14  4:51                                       ` Randy Brukardt
2014-11-15 17:32                                         ` Florian Weimer
2014-11-15 19:58                                           ` 'Image (was: What exactly is the licensing situation with GNAT?) Georg Bauhaus
2014-11-18  0:39                                             ` Randy Brukardt
2014-11-18  8:20                                               ` 'Image Björn Lundin
2014-11-18 22:29                                                 ` 'Image Randy Brukardt
2014-11-19 13:46                                             ` 'Image (was: What exactly is the licensing situation with GNAT?) Brian Drummond
2014-11-19 14:21                                               ` 'Image G.B.
2014-11-20 13:32                                                 ` 'Image Brian Drummond
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox