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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,dc1fff2721602dfa X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.84.164 with SMTP id a4mr751047paz.26.1359576157333; Wed, 30 Jan 2013 12:02:37 -0800 (PST) Path: s9ni26397pbb.0!nntp.google.com!news.glorb.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ada and string literals Date: Wed, 30 Jan 2013 20:02:34 +0000 Organization: A noiseless patient Spider Message-ID: References: <4978d638-a04b-4561-85e9-cf6620265af2@googlegroups.com> <86boc63n5d.fsf@gaheris.avalon.lan> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="c8da4aa61d590a5e477a2e03e552a940"; logging-data="20235"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/5stuDfSVhMHucEZTXZBzSE0AygGdDAY4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) Cancel-Lock: sha1:x9669aStJx8VFa+gj1zB3d0qkeI= sha1:JqtSHftG76N4/g7tshDl+id4I34= Content-Type: text/plain Date: 2013-01-30T20:02:34+00:00 List-Id: codeallergy writes: > Okay. assuming dat we use GNAT 2012 > > Literal1 : aliased constant String := "LITERAL"; > Literal2 : aliased constant String := "LITERAL"; > Literal3 : aliased constant String := "LITERAL"; > > how the above code is handled ? > > compiler duplicate the string three times into the data section or the > three constants will share the same string or one string into the data > section but duplicated at the run time ? There are three occurences of the string in the data section. Of course, there may be some GCC option to merge the strings - there's probably an option to make toast, come to that.