Liste des Groupes | Revenir à cl c |
Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:...
Valid responses to undefined behavior include "terminating a translation
or execution (with the issuance of a diagnostic message)". In other
words, if a compiler is able to prove that a program has undefined
behavior (that will occur on each execution), it can reject it at
compile time.
This was probably subject to previous disscussion here, IIRC
some posters here claimed that even in such case implementation
is supposed to produce an executable.
However, certainly
implementation must accept the program when code that would
exhibit undefined behaviour is not executed. And in practice
when using separate compilation compiler normally is not
able to decide if a function will be called or not (and even
when whole program is available compiler still have halting
problem to solve). So cases when compiler is allowed to report
compilation error are quite limite in practice.
Les messages affichés proviennent d'usenet.