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: Re: no code generation for c strings Date: Fri, 3 Jun 2016 21:30:49 +0100 Organization: Aioe.org NNTP Server Message-ID: <814658902.486678528.509196.laguest-archeia.com@nntp.aioe.org> References: <369391051.486634184.002061.laguest-archeia.com@nntp.aioe.org> <718de74d-ab15-4eee-983f-b78d8f8070f1@googlegroups.com> NNTP-Posting-Host: L/3Ua2dM6oCRC/18+A91Dg.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:bxg67zroiLexUOlp5m7GXL0DOJE= Xref: news.eternal-september.org comp.lang.ada:30591 Date: 2016-06-03T21:30:49+01:00 List-Id: Simon Wright wrote: > Lucretia writes: > >> Interesting, I tried this and dumped the asm, similar there, but as >> soon as you add more code, it just gets confusing, because it never >> references the actual label for the string anywhere. > [...] >> S3 : constant C.char_array := "hello" & C.char'Val (0); >> begin >> -- Put_Line (C.To_Ada (S3)); > > You've commented out the only place where the variable is referenced -- > here, it made up a label (LC1) and referenced that. > Yeah that was on purpose as it produced a lot of stuff that complicated looking at it, in hindsight I probably should've just done an assignment, might've produced less. I'm still not sure why your way of doing this produced the desired effect though.