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: cannot pass objects of non-POD type


On 10/24/07, John Gateley <gateley@jriver.com> wrote:
> I don't think it is undefined code. The class has no virtual functions,
> and the variable argument function doesn't need to know the full size
> of the struct, since it is not using it as a String object, it is using
> it as a char * pointer (which is what gets passed).

Does not matter if the class has no virtual functions or not.  The
class is a non POD.


> I'm not familiar with "ABI". But perhaps this has something to do
> with my other question: is the illegal instruction that gets executed
> a "real" illegal instruction, caused by g++ doing something different
> that I expected with the String object as an argument? Or is the illegal
> instruction just a "place marker" that is generated because I passed
> a non-POD as an argument?

The latter.  Again this is a non-POD.  Does not matter if the class
has no virtual functions or not, it is still undefined code.

-- Pinski


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