Paul Schlie wrote:

As in my mind, the semantics of foo() dictate that it print the value of
the storage location which was allocated to the variable "a", where unless
"a" is initialized with an explicit value, may be arbitrary. So I've got no
problem with arbitrary results or behavior, I just simply believe they are
implicitly constrained to the remaining rules of the language, i.e. all
side-effects must be expressed upon reaching a sequence point which
logically bounds the effects of the evaluation of any expression.

This cannot be formalized, and is not what the standard says. The fact that
you believe it is interesting (though I don't think you can write a formal
description of what you believe in C standard terms), but we operate by what
the standard formally says, not by what one person informally believes.

(where if an undefined behavior it did delete the program being executed it
wouldn't resume execution beyond the next sequence point, but if it does, it
must continue to abide by the languages rules regardless of the resulting
side effects from the preceding behaviors)

Sequence points simply do not have this semantics. If they did, then nearly
all useful optimizations would be prohibited. You are essentially positing
a model in which the state at every sequence point is not only defined by
the standard, but must be reflected in the implementation with no use of
as-if semantics. I don't see this as meaningful, and I don't think this can
be formalized. I am quite *sure* that it is undesirable.



Reply via email to