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!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: no code generation for c strings Date: Fri, 03 Jun 2016 22:25:13 +0100 Organization: A noiseless patient Spider Message-ID: References: <369391051.486634184.002061.laguest-archeia.com@nntp.aioe.org> <718de74d-ab15-4eee-983f-b78d8f8070f1@googlegroups.com> <814658902.486678528.509196.laguest-archeia.com@nntp.aioe.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="fa27e9c62dd412c1b6adffaac11b940a"; logging-data="6801"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/lBU8P1VD9QYHpNQDopWhklrMlLzCsjfQ=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:et7iD03JSEpcIPwpvSyfGRq7Xm8= sha1:7zLw75mfT1y9C3FOgL8PNQ12x+c= Xref: news.eternal-september.org comp.lang.ada:30594 Date: 2016-06-03T22:25:13+01:00 List-Id: Luke A. Guest writes: > 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. Possibly because it was in a spec? Yours was in a library-level subprogram, so there would have been no need for a related symbol?