https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85315

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to rguent...@suse.de from comment #4)
...
> If you eventually expect a true result then please no - this should be
> undefined.

The second test case in comment #4 is currently well-defined in C17 (by 6.5.9,
p6) and requires the function to return true if x and y are adjacent and i is
+/-1.  (I'm not defending the requirement.)

There is a proposal for C2X to make the result of the equality comparison
between a past-the-end pointer and another pointer unspecified instead (N2219).
 Would you prefer it to be undefined?  (Making it undefined would be a rather
drastic departure from the historical requirement and likely objectionable to
the authors.)

See http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2219.htm
(Scroll down to the Proposed Technical Corrigendum section at the end of the
paper to read the proposed changes.)

Reply via email to