help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

g++ implicit copy constructor portability?


From: fenwayfool
Subject: g++ implicit copy constructor portability?
Date: Sun, 8 Mar 2009 17:04:03 -0700 (PDT)
User-agent: G2/1.0

Does anyone know of portability issues regarding the implicit copy
constructor?

I'm porting some code written for WIndows & Linux into an embedded
system.  I have found that my stack gets corrupted (in the embedded
system) unless I create copy constructors for a few classes.  It seems
that on Linux this is not required since the original code relied on
the implicit copy constructor.

What complicates this a bit is that the objects in question have
objects in them based on templates.  Since all the objects in question
have operator= defined, writing the copy constructor was easy... but
I'm still not sure I solved the memory corruption issue or just moved
it so things just appear to work.

The compilers used are very different... I don't have the versions
handy but 1 is g++ on red hat while the other is a g++ cross compiler
for PPC.

Anyone have some advice?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]