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]

Re: Placement new[] weirdness


> Date: Fri, 16 Jul 1999 03:05:38 +0400 (MEDT)
> From: Andrey Slepuhin <pooh@msu.ru>

> >> This seems to be not conforming to C++ draft, clause 18.4.1.3
> >> (though conforming to 5.3.4).
> > 
> > What part does not conform to 18.4.1.3?  0xbffff714 is passed to the
> > placement new, and that value is returned.  A proof would show some
> > other value being passed to it.  Please show that.

> ???

Oops, I confused myself.  I meant 0xbffff710.  The 0xbffff714 comes
from the new expression.

> (gdb) br __vn__FUiPv
> Breakpoint 1 at 0x80487d4
> (gdb) run
> Starting program: /local/users/pooh/work/libp++/a.out 
> Breakpoint 1 at 0x4004b3a4
> 0xbffff6e4

> Breakpoint 1, 0x4004b3a4 in operator new [] (place=0xbffff6e4)
> (gdb) cont

Fine, but you failed to show the return value of the function.  You
can do this by saying fini here.  You will notice that, as per
18.4.1.3 that the same value (0xbffff6e4 in this case), is returned.

> Continuing.
> 0xbffff6e8

Yes, and this is via 5.3.4, as discussed in 5.3.4.

> So passed value differs from returned.

No, you have not shown that.

> This is separate topic. And there will be implementation problems,
> though this is possible.

I don't know of any, would you care to elaborate?


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