This is the mail archive of the gcc-bugs@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]

Internal compiler bug


Hi,

I have compiled the following code and the compiler prompts an
internal error. My version is
    egcs-2.90.27 980315 (egcs-1.0.2 release)
on Linux (RedHat -5.1 Distributions)


class Foo
{
public:

  // Abstract Method (implemented in derived subclasses)
  virtual void absMethod () = 0;
};


//External Function
void func(void *fooPtrAsVoid /*Generic address parameter*/)
{
  Foo* fooPtr;

  fooPtr=(Foo*)fooPtrAsVoid;  // Foo pointer cast

  // absMethod: must be implemented in derived class, but
  //            I want to check twice...
  if(fooPtr->absMethod)     // <=== Oohps.. Bug Crash
    foorPtr->absMethod();
}

// External Function cannot be called with Foo* parameter
// I must use void* with techniques like thread creation.

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