[info-performer] Performer C++ question- GNU gcc vs. IRIX CC

Date view Thread view Subject view Author view

From: John Kelso (kelso++at++nist.gov)
Date: 10/14/2005 07:13:31


Hi,

I have a function "foo" that returns a "pfCoord".

  struct pfCoord {
    pfVec3 xyz ;
    pfVec3 hpr ;
  }

In some cases I only need the xyz part of the structure, so I use:

  pfVec3 bar = foo().xyz ;

On Linux this works fine. bar has the correct value.

On IRIX I get trash in bar, and hose other data objects to boot!

My question: Is what I'm doing fundamentally a C++ no-no and I'm just
getting lucky on Linux? Or, is the SGI, either the CC compiler or the
Performer pfVec3 class, not doing the right thing?

BTW- my workaround is this, which works on both Linux & IRIX:
  pfCoord baz = foo() ;
  pfVec3 bar = baz.xyz ;

Thanks,

-John


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Oct 14 2005 - 07:16:26 PDT