If I understand correctly, this programme has undefined behavior in C++ because the intermediate value p + 1 is a pointer to uninitialized memory:
int main () {
int x = 0;
int *p = &x;
p = p + 1 - 1;
*p = 5;
}
If void were put in main's argument list (as required by the C grammar), would it also be undefined behavior in C?