From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.1 required=3.0 tests=BAYES_05,NICE_REPLY_A, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Did I find a (nearly-)gotcha here? Date: Sun, 14 Nov 2021 09:25:45 +0100 Organization: A noiseless patient Spider Message-ID: References: <29091147-1b81-4a3b-a646-c6a6d1ebe4ean@googlegroups.com> Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 14 Nov 2021 08:25:46 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="3a8f12fdf5f2e9071ff9e353f6241c40"; logging-data="14597"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lD0lW+4skY9MdCqPKN/ZhVhe8ukGkLDY=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Cancel-Lock: sha1:5m4oSSdfmQMj4ChbRRrcJenx60c= In-Reply-To: Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:63118 List-Id: On 13.11.21 09:53, Rod Kay wrote: > On 13/11/21 18:46, reinert wrote: >> >>     procedure test_a(ok :    out Boolean) is >>     begin >>        if false then >>           ok := true; >>        end if; >>     end test_a; >> >> However, I think I remember that (some) older versions of the GNAT compiler gave a different result. Could others try?  And does my program example reveal an unnecessary gotcha? >> >    I'd expect GNAT to issue a warning. Probably you need to add a flag to GNAT to enable that warning. Perhaps try adding '-gnatwa'. GCC's -Wuninitialized does as Rod Kay says.