Angus Leeming a écrit :
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
here my second one, we talk here about hundreds of warning per file. An
excerpt here:
d:/program/Qt/4.1.1//include/QtGui/../../src/gui/widgets/qcombobox.h:262:
warning: inline
function 'const QComboBoxPrivate* QComboBox::d_func() const' is declared
as dllimport: attribute ignored.
Right. This one is a right royal pain in the arse and there's absolutely no way
to turn it off without losing other interesting warnings. Curse Qt is the best I
can suggest.
Well, with Qt4, this happens only for "moc/*_moc.C". I had a look at
qtglobal.h and I saw this:
#ifndef Q_DECL_IMPORT
# ifdef Q_OS_WIN
# define Q_DECL_IMPORT __declspec(dllimport)
# else
# define Q_DECL_IMPORT
# endif
#endif
If I add -DQ_DECL_IMPORT all the warnings are transformed in errors:
d:/program/Qt/4.1.1//include/QtCore/../../src/corelib/tools/qbytearray.h:446:
error: cannot convert `const QByteArray' to `const char*' for argument
`1' to `int strcmp(const char*, const char*)'
By the way, what is the option to undefine a macro (opposite of "-D")?
Maybe we have a problem in the macro we pass to g++? Here is a typical
compil command:
g++ -DHAVE_CONFIG_H -I. -I. -I../../../../src -DQT_CLEAN_NAMESPACE
-DQT_GENUINE_STR -DQT_NO_STL -DQT3_SUPPORT -DQT_NO_TRANSLATION
-I../../../../src -I../../../../src/frontends
-I../../../../src/frontends/controllers -I../../../../src/frontends/qt4
-I../../../../src/frontends/qt4 -Id:/program/Qt/4.1.1//include
-Id:/program/Qt/4.1.1//include/Qt -Id:/program/Qt/4.1.1//include/QtCore
-Id:/program/Qt/4.1.1//include/QtGui
-Id:/program/Qt/4.1.1//include/Qt3Support -I../../../../boost -Wextra
-Wall -I/cygdrive/d/program/Aspell-0.60.4/include -O3 -c
QTocDialog_moc.C -o QTocDialog_moc.o
Who decide what macro to pass? The moc or our autotools script? Maybe
there something specific for Windows... Just thinking loud here.
What I tend to do (or did ;-)) is pipe the compiler output to a file and then
filter out those warnings I wasn't interested in.
Good idea but all those warnings slow down the compilation a lot.
Apparently it is just -Wextra that generates these warnings. The -Wall
option seems OK, so we will still keep a lot of warning if we remove
-Wextra from the autotools, won't we?
Thanks,
Abdel.