se***************@gmail.com wrote:
Does anybody know if it is allowed to compare pointer using the
operators '<', '<=', '>' or '>='?
Yes, but with limitations. You're allowed to compare any two valid or
null pointers of compatible types[1] using == and !=. Using <, >, <= and
>=, though, there is the additional demand that they must point within
the same object (array, struct, union, etc.). If not, the behaviour is
undefined. That also means that you can't compare to a null pointer
(constant) using < or >.
Richard
[1] Or pointers to void, or pointers to qualified versions of compatible
types, or null pointer constants.