This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/22485] pointer +- integer is never NULL
- From: "falk at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Sep 2005 09:39:30 -0000
- Subject: [Bug c/22485] pointer +- integer is never NULL
- References: <20050714131031.22485.mattias@virtutech.se>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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