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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ea88e33ca617708 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.35.131 with SMTP id h3mr3944619pbj.1.1321648916826; Fri, 18 Nov 2011 12:41:56 -0800 (PST) Path: h5ni6835pba.0!nntp.google.com!news2.google.com!postnews.google.com!a16g2000yqk.googlegroups.com!not-for-mail From: awdorrin Newsgroups: comp.lang.ada Subject: Re: Calling Ada Procedure from C - how to handle a char ptr/array Date: Fri, 18 Nov 2011 12:41:56 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <8e5541a3-cdd5-40af-a6fd-f7539ee61326@l19g2000yqc.googlegroups.com> NNTP-Posting-Host: 192.31.106.35 Mime-Version: 1.0 X-Trace: posting.google.com 1321648916 32564 127.0.0.1 (18 Nov 2011 20:41:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 18 Nov 2011 20:41:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a16g2000yqk.googlegroups.com; posting-host=192.31.106.35; posting-account=YkFdLgoAAADpWnfCBA6ZXMWTz2zHNd0j User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESRCNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0,gzip(gfe) Xref: news2.google.com comp.lang.ada:14459 Content-Type: text/plain; charset=ISO-8859-1 Date: 2011-11-18T12:41:56-08:00 List-Id: Tried reworking the code into a function that returns a char_array, but got a STORAGE_ERROR with a stack overflow/erroneous memory access. function Get_Label return Interfaces.C.Char_array is Label : String(1..8); begin Label(1..8) := "12345678"; return Interfaces.C.To_C(Label); end; >From the source code for To_C(), it allocates the char array, so I'm not sure why this error would be raised...