This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/22485] pointer +- integer is never NULL


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]