views:

41

answers:

2

I am receiving the following warning when compiling a Qt project, but ONLY on Mac OS X with GCC. Windows with MinGW and Linux with GCC do not emit this warning.

/Library/Frameworks/QtCore.framework/Versions/4/Headers/qtextcodec.h:175: warning: 'QCoreXmlStreamWriter' is already a friend of 'QTextEncoder'

Why is this showing up and how can I get rid of it? Did I include some headers in an incorrect order or something like that?

qtextcodec.h is included by QtCore, which I include in several header files.

Please let me know if more information is needed.

+2  A: 

According to the Qt issue tracker. It is a bug QTBUG-8243, but nobody has provided a work around. Perhaps browsing the patch they mention might shed some light.

Arnold Spence
Ah... looks like it'll be fixed for 4.7. I'm not using -Werror, so no worries. Just a little annoyance. :) Thanks for the info.
Jake Petroules
+1  A: 

Qtextcodec.h

friend class QXmlStreamWriter;
friend class QXmlStreamWriterPrivate;
#if defined(Q_OS_MAC32) || defined(Q_OS_AIX)
friend class QCoreXmlStreamWriter;
friend class QCoreXmlStreamWriterPrivate;
#endif

QCoreXmlStreamWriter seems to be just a define for QXmlStreamWriter (see qxmlstream.h), so it ends up declaring the same class as friend twice. So no, I don't think you can do anything about it, it's most probably a Qt buglet.

Frank