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!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Uninitialized out parameters. Date: Wed, 6 Apr 2016 15:54:44 -0500 Organization: JSA Research & Innovation Message-ID: References: <3be79ab3-ebc7-4169-9713-d50349662403@googlegroups.com> <70a76f87-51a9-4e77-9fa0-79714f9c0ba7@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1459976085 757 24.196.82.226 (6 Apr 2016 20:54:45 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 6 Apr 2016 20:54:45 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Xref: news.eternal-september.org comp.lang.ada:30019 Date: 2016-04-06T15:54:44-05:00 List-Id: "Dennis Lee Bieber" wrote in message news:c7t9gb1972nrm7e64hudekqvi5pmldtm17@4ax.com... ... >>The issue is rather, I think, whether V is returned at all. >>There would have to be an assignment within the null procedure. >> > Which could be a case if the compiler used copy-in/copy-out semantics > for scalars (or just copy-out for the test sample). GNAT, if I recall, > uses > reference semantics, and as out-only wouldn't be checking the initial > value > on entry. Scalars in Ada are always by-copy, so the *effect* always have to be copy-in/copy-out, regardless of how that's implemented. (I can't speak for GNAT, but Janus/Ada makes copies at the call-site if we want to/need to use by-reference parameter passing.) The rules for whether an out parameter is initialized (and if so, how) are complicated - see 6.4.1(12-15). 6.4.1(15) most likely applies in this case (assuming no Default_Value aspect is involved), and that says that the value is uninitialized. And of course the value of an uninitialized object can be anything. Randy.