comp.lang.ada
 help / color / mirror / Atom feed
* Streams and abnormality
@ 2012-06-12  9:31 Simon Wright
  2012-06-12 15:01 ` Adam Beneschan
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Wright @ 2012-06-12  9:31 UTC (permalink / raw)


Using this code with GCC 4.6, 4.7 and GNAT GPL 2011,

      Str : aliased {a child of Root_Stream_Type};
      subtype Short_Int is Integer range 0 .. 42;
      S : Short_Int;
   begin
      Integer'Output (Str'Access, -1);
      S := Short_Int'Input (Str'Access);
      Put_Line (S'Img & " " & S'Valid'Img);

I get the output " 63 FALSE".

 My reading of AARM05 13.9.1(4..6) [1] is that - because S is a scalar
 object - S should not have been allowed to become abnormal; I think
 that, instead, some exception (Constraint_Error? Data_Error?) should
 have been raised.

[1] http://www.adaic.org/resources/add_content/standards/05aarm/html/AA-13-9-1.html



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-06-21 18:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-12  9:31 Streams and abnormality Simon Wright
2012-06-12 15:01 ` Adam Beneschan
2012-06-12 17:03   ` Dmitry A. Kazakov
2012-06-12 17:32   ` Simon Wright
2012-06-12 18:06     ` Adam Beneschan
2012-06-12 19:49       ` Simon Wright
2012-06-21 18:29       ` Randy Brukardt

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