How to work around this compiler bug

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Christopher Zimmermann
Date: Saturday, May 1, 2010 - 2:39 am

Hi,

the following piece of code compiles fine using g++ 4.2.4, but 
fails using g++ 3.3.5 in the base system:

error: operands to ?: have different types

It is part of ptlib, which is the base library for opal, which in 
turn is needed for ekiga, which I'm trying to port.

What is your suggestion? Can anyone think of a workaround for 
this or should I just compile it using eg++ 4.2.4 ?


Christopher


#include<err.h>

#define WarnIfNULL(x) ((x) ? (x) : (warn("blub"),(x)))

class A
{
  protected:
    int a;
};

class B : A
{
  public:
    void blub()
    {
         WarnIfNULL(A::a);
    }
};
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
How to work around this compiler bug, Christopher Zimmermann, (Sat May 1, 2:39 am)
Re: How to work around this compiler bug, Landry Breuil, (Sat May 1, 3:07 am)
Re: How to work around this compiler bug, Marc Espie, (Sat May 1, 5:11 am)
Re: How to work around this compiler bug, Michael Small, (Sat May 1, 5:46 am)
Re: How to work around this compiler bug, Marco Peereboom, (Sat May 1, 8:12 am)
Re: How to work around this compiler bug, Christopher Zimmermann, (Sun May 2, 3:59 am)
Re: How to work around this compiler bug, patrick keshishian, (Sun May 2, 12:54 pm)
Re: How to work around this compiler bug, Marc Espie, (Sun May 2, 1:00 pm)
Re: [SOLVED] How to work around this compiler bug, Christopher Zimmermann, (Sun May 2, 1:21 pm)
Re: How to work around this compiler bug, Christopher Zimmermann, (Thu May 20, 6:18 am)
Re: How to work around this compiler bug, Landry Breuil, (Thu May 20, 6:52 am)
Re: How to work around this compiler bug, Christopher Zimmermann, (Thu May 20, 7:01 am)
Re: [SOLVED] How to work around this compiler bug, Christopher Zimmermann, (Thu May 20, 7:45 am)
Re: [SOLVED] How to work around this compiler bug, David Coppa, (Thu May 20, 12:04 pm)