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 gdr at integrable-solutions dot net  2005-07-15 14:43 -------
Subject: Re:  pointer +- integer is never NULL

"falk at debian dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| (In reply to comment #13)
| > Subject: Re:  pointer +- integer is never NULL
| > 
| > "falk at debian dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| > | Sorry, I cannot follow you. I'd find it massively unsurprising if
| > | reinterpret_cast<int*>(0) produces a null pointer, and if I then get
| > | undefined behavior for doing something with it that is undefined for a
| > | null pointer.
| > 
| > But, if I used reinterpret_cast to turn an integer value 0 into a
| > pointer, there is no reason why the compiler would assume that I do not
| > know the underlying machine and what I'm doing with the pointer.
| 
| The note merely requires the result of the mapping to be unsurprising;
| it does not say anything about further operations of this result. Therefore,
| it is completely irrelevant here.

The "side" notes were written by people who know what they
intend. Therefore their inputs are completely relevant here.

-- Gaby


-- 


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]