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!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: How to get Ada to =?utf-8?Q?=E2=80=9Ccross?= the =?utf-8?Q?ch?= =?utf-8?Q?asm=E2=80=9D=3F?= Date: Tue, 08 May 2018 23:42:58 -0700 Organization: A noiseless patient Spider Message-ID: <87k1sdcost.fsf@nightsong.com> References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <878t9nemrl.fsf@nightsong.com> <87h8nl50rw.fsf@nightsong.com> <87d0y97lda.fsf@nightsong.com> <87o9hsu3er.fsf@jacob-sparre.dk> <87efimy7x5.fsf@nightsong.com> <87efimtuua.fsf@jacob-sparre.dk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="a15f8e13c869a4517dec92123a650d01"; logging-data="28771"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18010LNUhCbIR96HMyIEUd2" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:h2ZbpjkkbfCznD17v5BEusz0QDw= sha1:m1AB+lGNYUUqPB70P8ZTNqPVauI= Xref: reader02.eternal-september.org comp.lang.ada:52145 Date: 2018-05-08T23:42:58-07:00 List-Id: Jacob Sparre Andersen writes: > Imagine it wasn't a string, but some other explicitly fixed size array. > I can't see how the compiler in this case can preallocate the array on > the primary stack as you write above. If it's fixed size, what's the problem? > It the explanation that C++ simply doesn't allow functions to return > indefinite types, I'm not sure what you mean by an indefinite type. If it means a type whose size isn't known at compile time, then I wouldn't consider it fixed size in the sense of the previous paragraph. https://en.wikipedia.org/wiki/Return_value_optimization discusses this topic in more detail.