This is the mail archive of the gcc@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]

Re: malloc attributes and realloc


Andreas Schwab <schwab@suse.de> writes:

[...]

| > Even on an segmented architecture it needs to be possible to compare
| > pointers.  If it were not necessary, why would realloc() docs talk about
| > "(possibly moved) block".
| 
| The standard actually says "(which may have the same value as a
| pointer to the old object)".  You can test for a subset of the "same
| value" condition by comparing the representation, and on an
| implementation where the indeterminate value of a pointer is never a
| trap representation you can even use == or !=, but that is not
| strictly compliant.

Well, the notion of "strictly conforming" is an oxymoron.  The point
of interest is whether it is conforming.  Any useful program will count,
in one way or the other, on some implementation-defined aspects.

I would be much more interested in what supports we do provide for
conforming programs -- not just for stricly conforming ones.  What
guarantees we do document.  Some languages, like C++, don't have that
trumping notion of "strictly conforming".

-- Gaby


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