Getting rid of the Nokia Qt SDK warnings
When the SDK beta came out, I posted a topic on Forum Nokia about the warnings emitted when compiling Qt Symbian programs. I also opened a bug report in the Qt bug tracker at the suggestion of Christian Kamm, but the warnings come from the Symbian headers, so it is unlikely that the Qt team can do much about it.
Here’s a workaround:
- Add the flags -Wno-attributes -Wno-parentheses to the Symbian compiler flags. This will fix the dllimport warnings and the “recommend parentheses around…” warnings. e.g: symbian {QMAKE_CXXFLAGS += -Wno-attributes -Wno-parentheses}
- Edit the file e32cmn.inl and replace the C-casts at the warning lines with reinterpret_cast. e.g: (const TSecureId&)iId will become reinterpret_cast<const TSecureId&>(iId). The conversion seems to be correct, even though the implementation is hack-ish.
In one project – after doing the two changes outlined above – the warning count was cut from ~4000 to about 41. There weren’t 4000 real warnings, more like ~100 but Qt Creator counts each warning line as a warning (this might be a bug).
The remaining warnings were:
- d32locd.h:189: warning: invalid access to non-static data member ‘TLocalDriveCaps::iSize’ of NULL object
- d32locd.h:190: warning: invalid access to non-static data member ‘TLocalDriveCapsV3::iFormatInfo’ of NULL object
- openfont.h:2549: warning: invalid access to non-static data member ‘COpenFontRasterizer::iDtor_ID_Key’ of NULL object
- openfont.h:2571: warning: invalid access to non-static data member ‘CShaperFactory::iDtor_ID_Key’ of NULL object
- biditext.h:12: warning: declaration ‘enum CGraphicsContext::TTextAlign’ does not declare anything
1-4 seem to be related to the use of the _FOFF macro., but I didn’t do any detailed analysis.
Comments are closed.