| Liste des Groupes | Revenir à cl c |
UB means precisely that I can choose trapping, or IB, or optimising on
the assumption it does not happen.
Making this UB is an admission of the blindingly obvious - there is no
correct answer when signed integer overflow occurs. It tells
programmers that it is a mistake to let your arithmetic overflow, and
it allows tools to help programmers avoid these mistakes, and it
allows compilers to give programmers the most efficient results from
known good code rather than adding unnecessary run-time checks that
are never triggered.
>I am happy knowing that I cannot divide by 0,Yup. That should be a trap.
For some programs, yes. For others, no.
I don't want to pay the price for checks, traps, and limited
re-arrangements and optimisations when I know my expressions don't
overflow. But I am also happy to be able to get a trap when I ask for
it.
Les messages affichés proviennent d'usenet.