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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,453ed54f02292eea X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Simple Ada question Date: 2000/05/21 Message-ID: <8g8q19$amd$1@nnrp1.deja.com>#1/1 X-Deja-AN: 625728948 References: <8f8fm5$de5$1@news.uit.no> <3923B647.82A765D4@bton.ac.uk> X-Http-Proxy: 1.0 x53.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sun May 21 13:58:04 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-05-21T00:00:00+00:00 List-Id: In article <3923B647.82A765D4@bton.ac.uk>, John English wrote: > I've seen enough students fall over this one that I wonder if a > compiler warning should be issued if the loop index has the same > name as a variable in the enclosing scope... In practice, GNAT will almost always give a warning in this case. If the outer variable is not referenced at all, then that will certainly generate a warning. If the outer variable is referenced after the loop, then a warning will be generated about reference to an uninitialized variable. This will not catch 100% of cases, but it's very close Sent via Deja.com http://www.deja.com/ Before you buy.