Ta, CornedBee. It made sense to me that comparing a free'd pointer with something wouldn't be defined. I read that section, but my mind must have drifted; one of the hazards of reading a standard, I guess.
Originally Posted by CornedBee
It would be a slightly interesting exercise to see if we can find a real compiler/library that, when it encounters this code...
does anything other than print "Yes!".
int *a, *b, *temp;
temp = malloc(2*sizeof(int));
a = temp;
b = temp + 1;
if (b > a) fprintf(stdout, "Yes!"); /* undefined behaviour here */