Article View: comp.std.c++
Article #1176Re: Pointer comparisons
From: Fergus James HENDERSON
Date: Tue, 29 Dec 1992 19:13
Date: Tue, 29 Dec 1992 19:13
35 lines
2059 bytes
2059 bytes
eker@loria.fr (Steven Eker) writes: >jss@lucid.com (Jerry Schwarz) writes: >|> >|> A: Does the ARM currently require a1!=a2? Apparently >|> not, but I may have overlooked something. > >Has anyone noticed that slist_base::get() on p266 C++PL (2ed) assumes that >pointers to different heap allocated objects compare unequal? I hadn't noticed that one, but on page 238 in string::operator=() it assumes that pointers to different strings compare unequal, whether heap allocated, stack allocated, or statically allocated. >Might this fail on a 486? Yes, but only if the programmer had invoked some operating system memory mapping function, in which case the consequences are on that programmer's head. It is not a matter for the standard to worry about. >There doesn't seem to be an easy fix for this example without maintaining >a separate tail pointer. Hopefully we can all agree that there is plenty of code around like these two examples, which we don't want to break. Whatever wording is adpoted by the standard, these examples should continue to work unmodified. Note carefully, however, that these examples do *not* depend on pointers to different *empty* objects comparing unequal. -- Fergus Henderson fjh@munta.cs.mu.OZ.AU This .signature virus is a self-referential statement that is true - but you will only be able to consistently believe it if you copy it to your own .signature file!
Technical Details
Message-ID:
<9236506.8328@mulga.cs.mu.OZ.AU>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjhReferences:
<1992Dec19.001851.22116@microsoft.com> <1992Dec23.182456.17185@lucid.com> <1992Dec24.200201.25709@microsoft.com> <1992Dec28.175218.15539@microsoft.com> <1992Dec29.042828.27808@lucid.com> <713@muller.loria.fr>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) Subject: Re: Pointer comparisons Message-ID: <9236506.8328@mulga.cs.mu.OZ.AU> Sender: news@cs.mu.OZ.AU Organization: Computer Science, University of Melbourne, Australia References: <1992Dec19.001851.22116@microsoft.com> <1992Dec23.182456.17185@lucid.com> <1992Dec24.200201.25709@microsoft.com> <1992Dec28.175218.15539@microsoft.com> <1992Dec29.042828.27808@lucid.com> <713@muller.loria.fr> Date: Tue, 29 Dec 1992 19:13:45 GMT Lines: 35