[Bug c/22485] pointer +- integer is never NULL
falk at debian dot org
gcc-bugzilla@gcc.gnu.org
Sat Sep 24 09:39:00 GMT 2005
------- Additional Comments From falk at debian dot org 2005-09-24 09:39 -------
(In reply to comment #21)
> There have been lots of messages exchanged on this topic. It was just
> pointed to me that the C++ standard -- unlike the C99 standard -- has the
> following wording 5.7/7:
Hmm, I missed that. So can we agree now the following implications are valid:
int *p, *q, x;
C99:
q = p +- x formed => p nonnull, q nonnull
x = p - q formed => p nonnull, q nonnull
C++:
q = p +- x formed, p nonnull => q nonnull
q = p +- x formed, x nonnull => p nonnull, q nonnull
x = p - q formed, p nonnull => q nonnull
x = p - q formed, q nonnull => p nonnull
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22485
More information about the Gcc-bugs
mailing list