bearophile wrote:
Walter Bright:
Global switches are not appropriate for anything other than
debugging, however, because some libraries may depend on overflow
arithmetic.
Right. If a library needs wrap arounds in numbers to work correctly,
it has to contain a command to locally switch off overflow checks;
such annotations override the global behavior of the compiler. This
is how things work in Pascal-like languages. And it also shows why
you need both global and local ways to switch them on and off.
I just find:
unchecked
{
... code ...
}
awfully ugly. I doubt it would be used where it would need to be. Global
switches that change the behavior of the language are bad, bad ideas. It
makes code unverifiable and hence untrustable.