| Deutsch English Français Italiano |
|
<86frh9ykrv.fsf@linuxsc.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups: comp.lang.c
Subject: Re: Loops (was Re: do { quit; } else { })
Date: Mon, 12 May 2025 07:19:00 -0700
Organization: A noiseless patient Spider
Lines: 75
Message-ID: <86frh9ykrv.fsf@linuxsc.com>
References: <vspbjh$8dvd$1@dont-email.me> <vti2ki$g23v$1@dont-email.me> <vtin99$vu24$1@dont-email.me> <vtiuf0$18au8$1@dont-email.me> <vtj97r$1i3v3$1@dont-email.me> <vtl166$36p6b$1@dont-email.me> <vtlcg0$3f46a$2@dont-email.me> <20250415153419.00004cf7@yahoo.com> <86h62078i8.fsf@linuxsc.com> <20250504180833.00000906@yahoo.com> <86plggzilx.fsf@linuxsc.com> <vvnsvt$3k1mu$1@dont-email.me> <86ldr4yx0x.fsf@linuxsc.com> <vvpmm2$3dhl$1@dont-email.me> <vvpsji$4jht$1@dont-email.me> <vvr5mg$l85c$1@dont-email.me> <87wmam4xa5.fsf@nosuchdomain.example.com> <868qn2zl1m.fsf@linuxsc.com> <87jz6m4m2o.fsf@nosuchdomain.example.com> <86selaxprh.fsf@linuxsc.com> <874ixq41xs.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Mon, 12 May 2025 16:19:01 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="74b4e5895be58ca73eb02e8f9ff401e1";
logging-data="1172805"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5mPFK4nIDGuz0KcJg1lW5pog8KZjyAcQ="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:v+ELdlfe7hHGuvaPUcxP6pacLz8=
sha1:1QGpB5JpCLu97cpqDPgdx2DFjvY=
Bytes: 4549
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>
>>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>>
>>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>>>
>>>>> James Kuyper <jameskuyper@alumni.caltech.edu> 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).
>>>
>>> I think that by "is ignored", you mean that compilers are not
>>> required to pay attention to it. [...]
>>
>> I mean it has no effect on program semantics.
>
> It affects whether a program has defined or undefined behavior.
> (Yes, a conforming compiler could ignore it.)
Please read again what I said: parameter array length information,
specified by way of 'static', is ignored _outside of function
definitions_.
>>>> Furthermore, and also like 'restrict', there is no general
>>>> way to verify at compile time that the stipulated condition
>>>> holds.
>>>
>>> Right, but that doesn't prevent implementations from issuing
>>> useful warnings when it can determine that the stipulated
>>> condition does not hold.
>>
>> True, but in many cases they can't, because that information
>> is not part of the function's type and so often it is not
>> present.
>
> Why would it not be present?
>
> If you mean that someone might use `[static N]` in a function's
> definition but not in a declaration, sure, but I would always
> make sure they match as closely as possible. [...]
It strikes me that you have a rather self-centered view of the
world. The vast majority of all C code is written by people other
than yourself.
>>>> 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.
>>>
>>> Observing the status quo is better than what, exactly?
>>
>> Better than than trying to retrofit an incompatible change that
>> would make an infringement be a constraint violation that can't
>> be checked anyway.
>
> And as you seem to have agreed, nobody suggested that. Were we
> supposed to guess what it's better than? Or did I miss something?
There was no reason to guess, because it was written in plain
English in the earlier posting.