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


On Sunday 4 January 2004 04:12, Kai Henningsen wrote:
> gdr@integrable-solutions.net (Gabriel Dos Reis)  wrote on 03.01.04 in 
<m34qvdq5jp.fsf@uniton.integrable-solutions.net>:
> >
> > And I will point out that libstdc++ depends on that pointer
> > ordering behaving "correctly" in its implementation of
> > std::less<T*>.
>
> Does it?
>
> That is, is that specified to work for two independent objects (as
> opposed to two different parts of the same object)?

Yes; see section 20.3.3 para 8 of the C++ standard. C++ (unlike C) does 
require a total ordering on all pointers (to a given type) to exist, 
accessible through std::less although not necessarily through <.

-- 
Ross Smith ......... r-smith@ihug.co.nz ......... Auckland, New Zealand
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe trying
to produce bigger and better idiots. So far, the Universe is winning."
                                                          -- Rick Cook


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