This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Problems compiling KDE programs with GCC 3.3+
- From: Andreas Jaeger <aj at suse dot de>
- To: gcc at gcc dot gnu dot org
- Cc: dmuell at gmx dot net
- Date: Sun, 12 Jan 2003 18:51:19 +0100
- Subject: Problems compiling KDE programs with GCC 3.3+
With GCC 3.3 most qt and KDE programs fail - and those worked fine
with GCC 3.2 and older.
Dirk Müller came up with this example program:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class QChar {
public:
QChar( char c );
QChar( unsigned char c );
};
class QString
{
public:
QString( const char *str ); // deep copy
QString &insert( unsigned int index, const QString & );
QString &insert( unsigned int index, QChar );
QString &prepend( const char* );
};
inline QString &QString::prepend( const char* s )
{ return insert(0,s); }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling with different compilers shows that GCC 3.3 and newer give
different results than the older compiler:
gromit:~/tmp:[1]$ /opt/gcc/3.2-devel/bin/gcc -c kde.cc -Wall
gromit:~/tmp:[0]$ /opt/gcc/3.3-devel/bin/gcc -c kde.cc -Wall
kde.cc: In member function `QString& QString::prepend(const char*)':
kde.cc:18: error: call of overloaded `insert(int, const char*&)' is ambiguous
kde.cc:12: error: candidates are: QString& QString::insert(unsigned int, const
QString&)
kde.cc:13: error: QString& QString::insert(unsigned int, QChar)
gromit:~/tmp:[1]$ /opt/gcc/3.4-devel/bin/gcc -c kde.cc -Wall
kde.cc: In member function `QString& QString::prepend(const char*)':
kde.cc:18: error: call of overloaded `insert(int, const char*&)' is ambiguous
kde.cc:12: error: candidates are: QString& QString::insert(unsigned int, const
QString&)
kde.cc:13: error: QString& QString::insert(unsigned int, QChar)
My question now is whether this is a bug in GCC 3.3 (in that case I'll
file a bug report) - or whether QT is broken,
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj