J
James Kanze
James Kanze said:When undefined behavior occurs, anything the program does is[...]
Of course, the specification did state that the "range can be
maximally RAND_MAX + 1", so normally, I would expect an
assertion failure if my argument wasn't in this range. Or
totally undefined behavior, but not the function arbitrarily
changing my argument.
Surely arbitrarily changing the argument *is* an example of "totally
undefined behavior".
correct. But from a quality of implementation point of view, we
don't normally expect it to go out of the way to make things
worse; *IF* the code detects the error, it should treat it as an
error.Certainly.
By snipping the smiley, you've made it appear that I was making a
serious point. I wasn't.
Sorry. I missed the smiley. So it looks like we're in violent
agreement.