comp.lang.ada
 help / color / mirror / Atom feed
* To collection (GNAT bug)
@ 2006-09-30 19:46 Dmitry A. Kazakov
  2006-10-01  1:21 ` Jeffrey R. Carter
  0 siblings, 1 reply; 19+ messages in thread
From: Dmitry A. Kazakov @ 2006-09-30 19:46 UTC (permalink / raw)


The following does not work in GCC 4.1.1 (20060525), as well as in 3.15p
-----------------
with Ada.Unchecked_Conversion;

with Ada.Text_IO;  use Ada.Text_IO;
with System;       use System;

procedure Test_String_Ptr is
   type Ptr is access String;
   function To_Addr is new Ada.Unchecked_Conversion (Ptr, Address);
   function To_Ptr  is new Ada.Unchecked_Conversion (Address, Ptr);
   X    : Ptr;
   Y    : Ptr;
   Addr : Address;
begin
   X    := new String'("A");
   Addr := To_Addr (X);
   Y := To_Ptr (Addr);
   Put_Line (Y.all);
   Y := To_Ptr (Addr);
   Put_Line (Y.all);
   Y := To_Ptr (Addr);
   Put_Line (Y.all);
   Put_Line ("It must have been three lines ""A""");
end Test_String_Ptr;

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

end of thread, other threads:[~2006-10-04 18:51 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-30 19:46 To collection (GNAT bug) Dmitry A. Kazakov
2006-10-01  1:21 ` Jeffrey R. Carter
2006-10-01  8:00   ` Dmitry A. Kazakov
2006-10-01 19:23     ` Jeffrey R. Carter
2006-10-01 22:33       ` Frank J. Lhota
2006-10-02  3:08         ` Jeffrey R. Carter
2006-10-02 13:02           ` Frank J. Lhota
2006-10-02 19:50             ` Jeffrey R. Carter
2006-10-02  8:23       ` Dmitry A. Kazakov
2006-10-02 13:06         ` Frank J. Lhota
2006-10-02 13:43           ` Dmitry A. Kazakov
2006-10-04 17:18             ` Adam Beneschan
2006-10-04 18:51               ` Dmitry A. Kazakov
2006-10-02 19:45         ` Jeffrey R. Carter
2006-10-03  8:36           ` Dmitry A. Kazakov
2006-10-03 19:10             ` Jeffrey R. Carter
2006-10-04  8:01               ` Dmitry A. Kazakov
2006-10-04  9:27                 ` Georg Bauhaus
2006-10-04 12:10                   ` Dmitry A. Kazakov

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