Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Loops (was Re: do { quit; } else { })
Date: Sun, 11 May 2025 18:15:33 -0700
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <868qn2zl1m.fsf@linuxsc.com>
References: <20250413072027.219@kylheku.com> <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>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Mon, 12 May 2025 03:15:34 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="74b4e5895be58ca73eb02e8f9ff401e1";
logging-data="765375"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NLutxGDK0MSvh3ki08TyT7A2/FTfOq1M="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:Dq4JVhpj4Pg+/5jAE0HuNXPC64o=
sha1:hYB58uqVX8DeTACIGnUctvvQPww=
Keith Thompson writes:
> James Kuyper writes:
> [...]
>
>> It's main potential usefulness is not in the definition of the
>> function, but in calls to the function. If the calls occur in
>> a different translation unit from the definition, the compiler
>> does not have the needed information.
>
> It does if the visible declaration has the same information.
Like 'restrict', parameter array length information, specified by
way of 'static', is ignored outside of function definitions. As
was intended (with 'restrict' also).
Furthermore, and also like 'restrict', there is no general
way to verify at compile time that the stipulated condition
holds.
Considering the above, it's better to observe the status quo, and
leave any diagnostics up to the discretion of the implementation,
rather than try to retrofit an incompatible change that would
make an infringement be a constraint violation that can't be
checked anyway.