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: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Uninitialized out parameters. Date: Wed, 6 Apr 2016 14:01:31 -0700 Organization: A noiseless patient Spider Message-ID: References: <3be79ab3-ebc7-4169-9713-d50349662403@googlegroups.com> <4b5fb0cb-2dbd-47c1-a5e2-41d4ffcab84e@googlegroups.com> <531318fc-daf0-4f4e-bc82-2b48699f3cb5@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 6 Apr 2016 20:58:16 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="48b46be33beed75863f69afa437f956b"; logging-data="18477"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EY81+Yk/kk7Px4L5yZShFm6n7qYvxtW4=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: Cancel-Lock: sha1:5e+As0LLcYZaaRxB97zVF3rW2eo= Xref: news.eternal-september.org comp.lang.ada:30020 Date: 2016-04-06T14:01:31-07:00 List-Id: On Tuesday, April 5, 2016 at 4:07:18 PM UTC+2, ah...@marriott.org wrote: > > In my gpr I compile with > package Compiler is > for Default_Switches ("ada") use ("-O1", "-gnatQ", "-gnato", "-g", "-gnat12", > "-gnatwcehijkmopruvz.c.n.p.t.w.x", "-gnatykmpM120"); > end Compiler; I think the first question is whether the procedure is called at all. Since the compiler knows it's null and so is supposed to do nothing, and since optimization is turned on, it seems a reasonable optimization to eliminate the call. The the value passed to 'Img is whatever bits you get from an uninitialized variable of the type. -- Jeff Carter "You can never forget too much about C++." 115