Rainer said:
That's a claim which should be easy to prove: Assuming you are not
deliberatetly misunderstanding me, you appear to claim that 'undefined
behavious' is actually behaviour defined by the C-standard.
No. He made no such claim. The phrase "undefined behavior" is defined
by the C standard, but the meaning it defines for that phrase is
precisely that the C standard does NOT define the behavior referred to
by that phrase.
... Since 'no
requirements' isn't a definition of any specific behaviour,
Correct. A definition of a specific behavior is neither given nor
needed nor even desireable in this context. What is defined is a
category of behavior, namely the universal category, which contains
all behaviors.
... this
definition or set of definitions must be in some other location, so
No. "no requirements" means that any specific behavior qualifies.
please cite where the standard provides a definition of the allowed
semantics for undefined behaviour.
"no requirements" => therefore all semantics are allowed.
NB: A positive definition is required.
Tough luck; you may require it, but the standard chose to define it
negatively.
More correctly (as I have written several times now): There is no such
Repeating it doesn't make it so.
thing as 'acceptable behaviour' for these case (provided you cannot
magically come up with a positive definition of this beahviour)
because no acceptable behaviour is defined.
"no requirements" means that all behavior is acceptable. You've
exactly reversed the intended meaning of the phrase "undefined
behavior". Could you recommend alternative wording for that
definition which would give it the same meaning, as you understand it,
that the rest of us consider to be given by the current wording?
... Presumably, a real-world
implementation of C will have 'some behaviour' in such situation and
whatever this might be is not relevant for determining the standard
conformance of this implementation.
True, and the reason why it's not relevant is precisely because that
behavior is acceptable. If no behavior were acceptable, the occurance
of any actual behavior (including doing nothing) would render the
implementation non-conforming.
....
Assuming that the C-standard is relevant for defining the C language,
it is the only location where 'behaviour' can be defined and you are
Incorrect, the C standard very explicitly allows that some code has
behavior which is defined by the implementation, but that's just a
single counterexample. For the more general case, look at section 1 of
the standard, titled "Scope". It specifies what things are within the
scope of the standard, and what things are not. If you compare those
two lists, I think it's clear that a very large portion of the things
that should properly be called the "behavior" of a program lie outside
the scope of the standard. To take a very simple case, an important
aspect of any program's behavior is how fast it executes; the C
standard does not specify anything, anywhere, about how fast a program
should execute; that's outside the scope of the standard.