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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Luke A. Guest Newsgroups: comp.lang.ada Subject: no code generation for c strings Date: Fri, 3 Jun 2016 09:14:36 +0100 Organization: Aioe.org NNTP Server Message-ID: <369391051.486634184.002061.laguest-archeia.com@nntp.aioe.org> NNTP-Posting-Host: NQDg31hMnRq1+o4iiqhGMg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: NewsTap/5.1.8 (iPhone/iPod Touch) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:bJD48FbWCWMtNd7JqT3RaISZHIg= Xref: news.eternal-september.org comp.lang.ada:30570 Date: 2016-06-03T09:14:36+01:00 List-Id: Hi, In my current binding efforts I'm having to have a bunch of c strings which denote the function name that needs to be requested from the API. If I create an Ada string and convert it to c then whole application gets two copies of each string which is overkill. What I would like to have is have the compiler recognise that I've declared a static char_array and just not generate a call to the secondary stack to allocate a new string. Is this actually possible? -O2/3 still generate the call. S : constant char_array := to_c ("hello" & nul);