Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Can your C compiler do this:

Name: Anonymous 2010-05-15 15:06


int main()
{
  int *p;
  p  = 0;
  *p = 0;
  return 0;
}


?

Name: Anonymous 2010-05-16 4:37

>>31
The problem is that we have different ideas of what constitutes a valid address, and you should note that the spec uses careful language. (I really don't like your definition for reasons I don't care to get into and I have a feeling that's what is being reflected in the spec.)

I have noticed, however:
if it can, then there has to be some value for a pointer to it that compares unequal to a null pointer.
It's not too uncommon for memory contents to start at some block and repeat at regular intervals, that is: accesses to addresses within a certain range are effectively modulo some constant. This can leave 0x00000000 as 'valid' while still providing objects there at unequal locations. (If it runs the whole address space, it also poses serious problems for coming up with an invalid address anywhere. However, according to the spec, there are still options--such as never providing pointers to extant objects at those locations.)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List