Well played, medical test

I have a few problems with this...

A pointer to address 1 and a pointer to address 2 can be added together to point to address 3

Can you give an example of that in code? I mean, would you want to write something like

int value_at_sum(int* a, int* b) {
  int* c = a + b;  // Invalid operands
  return *c;
}

even if you could?

They are, by definition, integer types.

Well, not to be a lawyer, but since you brought it up... Who defines pointers as integer types? This isn't a rhetorical question; I really want to know if that's done. For example, C99 explicitly says that size_t and ptrdiff_t are integer types, and POSIX says that off_t is an integer type. On the other hand, C99 says "Any pointer type may be converted to an integer type", which strongly suggests that a pointer type is not already an integer type.

Prohibiting a class of math ops between pointers only forces people to use integers for offsets -- inevitably resulting in type errors on odd architectures when the integer type chosen is of a different size.

This is a great point, but I wouldn't say it's inevitable that people use the wrong integer type for offsets. It's just very easy to make a mistake.

The commenters have probably never used an architecture with segmented memory.

Do you mean only that segmented memory increases the size of pointers, or is there some trickier issue here that also makes it attractive to use pointer types to represent offsets?

we can add two off_t together

Sure, and we can also add to size_t together or two ptrdiff_t together. On the other hand, we wouldn't try to add two file descriptors together.

/r/funny Thread Parent Link - i.imgur.com