This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos 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: Usefulness of CYGFUN_INFRA_EMPTY_DELETE_FUNCTIONS


"Christopher Cordahi" <christopher.cordahi@gmail.com> writes:
> On 06/02/07, Andrew Lunn <andrew@lunn.ch> wrote:

[...]

> I created and destroyed a C++ object with a virtual destructor that
> was on the stack and the the free function wasn't included in the
> object code since there wasn't any dynamic memory.

Depending on GCC version, it could be not enough to just have one virtual
destructor, -- you may need to have inheritance to see the problem, e.g.:

struct A {
  virtual ~A();
};

struct B: public A {
  virtual ~B();
};

A::~A() {}
B::~B() {}

When I compile this file to assembly, I see a call to __builtin_delete
using old versions of GCC (2.95.x), and calls to an external symbol
_ZdlPv using newer version of GCC :(

-- Sergei Organov.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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