 <p>Yes, it is safe. From [6.5.9] of the C99 standard (emphasis mine):</p> <blockquote> <p><strong>Two pointers compare equal if and only if</strong> both are null pointers, <strong>both are pointers to the same</strong> object (including a pointer to an object and a subobject at its beginning) or <strong>function</strong>, both are pointers to one past the last element of the same array object, or one is a pointer to one past the end of one array object and the other is a pointer to the start of a different array object that happens to immediately follow the first array object in the address space.</p> </blockquote>