I
Ivan A. Kosarev
Douglas A. Gwyn said:It's a matter of the source code, and what it does.
If the source invokes undefined behavior, then the
Standard doesn't specify what the abstract machine
should do.
Douglas, there is obvious inconsistency in your wordings:
In that example the compiler cannot see any array bound.
However, your last wording above says that if the code should cause
undefined behavior, then it's not important whether the compiler can see the
bounds.
Naturally, assuming
void *p = malloc(sizeof(int) + sizeof(double));
which of the lines
(int*) p + 1 or
(double*) p + 1
contradicts C99 6.5.6, i.e. causes undefined behavior on the abstract
machine? If they don't, can you refer to a wording of the Standard that
says that there is an exception for the point?