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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,17f2366fc6172420,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!m7g2000vbn.googlegroups.com!not-for-mail From: kug1977 Newsgroups: comp.lang.ada Subject: Access Type Date: Fri, 24 Dec 2010 08:36:12 -0800 (PST) Organization: http://groups.google.com Message-ID: <8d8e1094-d021-4456-85fb-bbb2f3911334@m7g2000vbn.googlegroups.com> NNTP-Posting-Host: 80.81.9.126 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1293208572 8115 127.0.0.1 (24 Dec 2010 16:36:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 24 Dec 2010 16:36:12 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m7g2000vbn.googlegroups.com; posting-host=80.81.9.126; posting-account=3ciIaAoAAAA6pCfildcdAcuc3UQuirtL User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-us) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:17095 Date: 2010-12-24T08:36:12-08:00 List-Id: Hi, this drives me crazy, because it makes me think that I don't get this access concept in Ada ... hope someone can help here. 1. I've a Ada-function which use a string for calling a service, say "open". This strings have to be LATIN1, so I've a type for this type t_OFW_Service_Name is array (Positive range <>) of Character; 2. The calling Ada-function have to use a pointer to this array, to call this function, so I use type t_OFW_Service_Name_Access is access t_OFW_Service_Name; 3. As this strings are all constant over the live-time of the programm, I want them declare as a private constant like this open_SERVICE_NAME : aliased t_OFW_Service_Name (1 .. 5) := "open" & Ada.Characters.Latin_1.NUL; 4. In my Ada-function, I use record-set like this type Ci_Args is record Service : t_OFW_Service_Name_Access; Num_Of_Args : Cell; Num_Of_Ret_Vals : Cell; Boot_Specifiers : System.Address; end record; Arg : Ci_Args; which I fill like this Arg.Service := boot_Service_Name'Access; Compilation failed with the following messages: - object subtype must statically match designated subtype - warning: aliased object has explicit bounds - warning: declare without bounds (and with explicit initialization) - warning: for use with unconstrained access Brings me to the following questions. - what mean this warnings and errors? - how can I point to a constant string. - Is there a easy to read tutorial about Pointers in Ada? Thanks for your help. kug1977