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 Carter Newsgroups: comp.lang.ada Subject: Re: Compiler checking of String lengths during assignment (Newbie Question) Date: Fri, 16 Jan 2015 08:44:28 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <77d434cc-00bc-4a2f-b50e-40736abdd2b2@googlegroups.com> <93725194-bf90-400f-844f-7d0d49adf030@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Fri, 16 Jan 2015 15:44:01 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="3da8e3f3a7453b5ebbe03ccf104af7b2"; logging-data="19995"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vXmj733fQWh2smDtg/ap1RrI8XU8D1kU=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: Cancel-Lock: sha1:M3ew7BTv9wSPyS8Q8d/PzBCOPTk= Xref: news.eternal-september.org comp.lang.ada:24594 Date: 2015-01-16T08:44:28-07:00 List-Id: On 01/16/2015 12:28 AM, Simon Wright wrote: > > It was Adam, not Bob. I apologize for the misattribution. > and, while I agree with you that the OP should have posted a compilable > example that demonstrated the problem, the posted code had nothing > between the assignment to i and the assignments to Head. True, but if the elided code is sufficiently complex, the compiler may have given up trying to track the value of I, even though the code fragment alone is simple enough for the compiler to do so. (I know nothing about the compiler code that does that kind of tracking, but when faced with identical code that gives different warnings when isolated than when embedded in other code, it seems logical to assume that the presence of the other code is the reason.) -- Jeff Carter "There's no messiah here. There's a mess all right, but no messiah." Monty Python's Life of Brian 84