Sujet : Re: Loops (was Re: do { quit; } else { })
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.cDate : 11. May 2025, 23:30:35
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vvr8eb$l85c$2@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 22
User-Agent : Mozilla Thunderbird
On 5/11/25 18:06, Keith Thompson wrote:
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.
True - I was responding to his claim that the information in the
declaration was unneeded, because it's implicit in the function
definition. That would be true if the primary purpose of this feature
was to enable optimizations, but I don't thing it was. I think it was
primarily intended to motivate (but not, unfortunately, mandate)
warnings when the undefined behavior is predictable at compile time.