The C Programming Language book by Brian W Kernighan & Dennis M. Ritchie, 2e, states the following on Pages 102-103:
… pointers may be compared under certain circumstances. If p and q point to members of the same array, then relations like ==, !=, <, >=, etc., work properly. But the behavior is undefined for arithmetic or comparisons with pointers that do not point to members of the same array. (There is one exception: the address of the first element past the end of an array can be used in pointer arithmetic).
Does this restriction apply to C++ as well? We have some legacy code that compares pointers (especially void*) based on their absolute address values, without considering whether or not they belong to the same array, and I am worried whether we need to revisit that code.