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 16:01:46 -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 1459976507 994 24.196.82.226 (6 Apr 2016 21:01:47 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 6 Apr 2016 21:01:47 +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; Response Xref: news.eternal-september.org comp.lang.ada:30021 Date: 2016-04-06T16:01:46-05:00 List-Id: I said: > It *seems* like checks like the one Ahlan is suggesting are a good idea, > until you trip over one. (The check in Ada that every function have at > least one return is a similar idea, which causes no end of trouble.) On top of that, exactly what would the check be? Which of the following ought to be illegal? procedure Foo1 (Obj : out Positive) is null; procedure Foo2 (Obj : out Positive) is begin null; end Foo2; Debug : constant Boolean := False; procedure Foo3 (Obj : out Positive) is begin if Debug then Put_Line ("Foo3 called"); end if; end Foo3; Foo1 and Foo2 are semantically identical (Foo1 is in fact defined in terms of Foo2). But it is clearly a lot harder for an Ada compiler to detect Foo2 compared to Foo1 (and changing between them is common). Having different legality for Foo1 and Foo2 would be annoying at best. Obviously, detecting Foo3 is even harder for a compiler, but again, semantically it is identical to Foo2. So where do you stop? And why? Randy.