Liste des Groupes | Revenir à cl c |
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).
? What "static" does when applied to an array parameter's length is to
render the behavior undefined if the function is called with a pointer
that points to an array that is shorter than the specified length. Are
you saying that it has no such effect except for inside the function
definition? I'm not sure what that would even mean - is the behavior
undefined only for recursive calls to the function?
Furthermore, and also like 'restrict', there is no general>
way to verify at compile time that the stipulated condition
holds.
As I already mentioned, if such verification could have been
generally possible, it should have been a constraint violation.
Because it is not possible in general, but only in certain cases,
making the behavior undefined is the best that can be done. Doing
so encourages implementations to generate a diagnostic when those
cases do come up.
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.
I was not suggesting any change to the status quo, [...]
Les messages affichés proviennent d'usenet.