Sujet : Re: Loops (was Re: do { quit; } else { })
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.cDate : 13. May 2025, 00:53:14
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vvu1la$1c54u$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Mozilla Thunderbird
Tim Rentsch <
tr.17687@z991.linuxsc.com> 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.