Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: James Kuyper Newsgroups: comp.lang.c Subject: Re: Loops (was Re: do { quit; } else { }) Date: Mon, 12 May 2025 19:53:14 -0400 Organization: A noiseless patient Spider Lines: 13 Message-ID: References: <20250415153419.00004cf7@yahoo.com> <86h62078i8.fsf@linuxsc.com> <20250504180833.00000906@yahoo.com> <86plggzilx.fsf@linuxsc.com> <86ldr4yx0x.fsf@linuxsc.com> <87wmam4xa5.fsf@nosuchdomain.example.com> <868qn2zl1m.fsf@linuxsc.com> <86o6vyxoit.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 13 May 2025 01:53:15 +0200 (CEST) Injection-Info: dont-email.me; posting-host="f57d7fcc1452e71e0d16aa59c1f0f874"; logging-data="1447070"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DsoYoliZYLRqSV1XebwoHSl1h/7EYRAw=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:s4lNzceKBYeRFCBkXDx6MZbUGg0= Content-Language: en-US In-Reply-To: <86o6vyxoit.fsf@linuxsc.com> Tim Rentsch writes: [...] > It isn't just that checking the condition cannot be done in general. > To be reliable the parameter length information would need to be > part of the function's type. The problem is much deeper than that. The same pointer can point to different arrays, or different positions in the same array, during different passes through the same line of code. Some of those would violate this rule, others would not. I don't see how violating such a rule could ever be made a constraint violation. The violation would have to be detected in the code that sets the pointer's value before passing it, directly or indirectly, to the function with a "static" array length.