Liste des Groupes | Revenir à l c |
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:The UB is actually at the function call site, rather than in the function itself. Thus adding a "static N" to the function definition can change the semantics of the call site:Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:It affects whether a program has defined or undefined behavior.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.
(Yes, a conforming compiler could ignore it.)
Les messages affichés proviennent d'usenet.