Phil said:
Keith Thompson said:
Phil Carmody said:
[...]
Is func( z, z++, z++) a constraint violation?
No, but its behavior is undefined.
Yes, it indeed violates the contraints that guarantee definedness
of the behaviour.
"Constraint" has a specific meaning in C. func(z, z++, z++)
violates no constraint.
It also has a specific meaning in English.
It's bad communications skills to use the ordinary English meaning of
the term, when writing in a context such as this newsgroup where a more
precise technical meaning of the term is (and should be) considered the
default. If you insist on doing so, you should flag the fact somehow.
However, that doesn't matter. Even by the ordinary meaning of the word,
you're misusing it. When the standard says that the behavior is
undefined, it's not a punishment for violating a rule, it's simply a
decision not to impose any requirements. Programmers are perfectly free
to write such code, and implementations are free to do whatever they
want to do with such code - which is precisely the problem. Undefined
behavior is not a constraint violation, it's the absence of constraints
(in the ordinary English meaning of the term) imposed by the standard on
the behavior of the program. The standard actually says "imposes no
requirements", but if you're going to insist on using words with their
fuzzy ordinary English meanings, then "requirements" comes close enough
for this purpose.