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.
It’s late at night and I’ve just found out some news about the subway worker’s strike in my city. A friend of mine will use the subway tomorrow to go to work and I want to tell them about it. Problem is, they’re already asleep.
I know – I’ll download a SMS scheduling app from the Nokia Ovi Store, type the message and the app will send it tomorrow morning, just in time for my friend to read it.
My Ovi client doesn’t work any more after the latest E72 update, so I use the native browser. It goes like this: I open the Ovi website and search for “sms schedule”. Nothing. I search for “sms scheduler” and check the three relevant results. On a second look, it’s the same app with three different prices.
They have the same description too, so I give up and just pick the second most expensive. “Want to send a Time Based SMS to be Sent Later? Write it now & Forget it! It will be Auto Sent.” Who are these guys? I visit their website and discover that they are one of the “Largest Developers of Mobile Applications in the World”. And they like to randomly capitalize words.
A few searches later I find another scheduler app and open its description – “The application will silently assist you and won’t bother when you have limited time. You’re able to create and manage short messages in an ordinary way.”
I decided that it’s safer to wake up in the morning to tell my friend about the strike.
The latest software update for the E72 brings bug fixes, improvements and new software, but also a very annoying bug: applications such as Ovi maps and Ovi store stop working once encryption is turned on. Unfortunately for Qt developers, all Qt apps stop working too.
Turning off encryption makes all the programs work again.
QsLog now on Symbian
I have ported my Qt logger to Symbian and it’s available for download from the usual bitbucket repository.
The port didn’t involve many changes:
- I have fixed a bunch of warnings caused by the Symbian GCC not liking if(); These could have probably been disabled with compiler options, but I just replaced the ; with an empty block.
- I have added Symbian-specific debug output. The logging output will be captured by Qt Creator and shown in the “Application output” view.
Via Lucian from Symbian dev foundation I found out that the recommended folder to place your logs on Symbian is c:/Logs/<dir>. I use the program name as <dir>, but it’s not mandatory.