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=-1.9 required=5.0 tests=BAYES_00,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5bd51db1b3bd8a14,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-12 04:56:57 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!130.133.1.3!fu-berlin.de!news.uar.net!carrier.kiev.ua!news.kiev.sovam.com!Svitonline.COM!not-for-mail From: "Maxim Reznik" Newsgroups: comp.lang.ada Subject: how to get aliased string pointer Date: Thu, 12 Jul 2001 14:55:10 +0300 Organization: Svit Online (post does not reflect views of Golden Telecom) Message-ID: <9ik3a4$1pd8$1@news.kiev.sovam.com> NNTP-Posting-Host: 212.109.37.91 X-Trace: news.kiev.sovam.com 994939016 58792 212.109.37.91 (12 Jul 2001 11:56:56 GMT) X-Complaints-To: abuse@svitonline.com NNTP-Posting-Date: 12 Jul 2001 11:56:56 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2479.0006 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006 Xref: archiver1.google.com comp.lang.ada:9864 Date: 2001-07-12T11:56:56+00:00 List-Id: Hello CLA, Compiling following programm in GNAT3.13p I get error aaa.adb:16:10: object subtype must statically match designated subtype procedure aaa is type Shared_String (Length : Natural) is record Count : Natural := 1; Space : aliased String (1 .. Length); pragma Atomic (Count); end record; type String_Access is access all String; p: String_Access; str: Shared_String(10); begin p:=str.Space'Access; end; Actually I would like to have a function that returns String_Access pointed to string located in an Shared_String object. function Get_String (U : Shared_String_Access) return String_Access is begin return U.Space'Access; end; Is there any way to make such function? As far as I understand I unable to convert constrained subtype to unconstrained. -- Maxim Reznik