PDA

View Full Version : disabeling unused parameter warnings



Cruz
20th August 2010, 13:13
Hello!

Can anyone tell me please how I can disable "unused parameter" compiler warnings?

Thank
Cruz

JPNaude
20th August 2010, 13:42
Check out the Q_UNUSED macro.

Cruz
20th August 2010, 13:56
Thanks, but it's not what I'm looking for. With the Q_UNUSED macro I have to manually specify every single unused parameter and that would be very tiresome. Isn't there a simple way, say in the .pro file, to disable all unused parameter warnings?

squidge
20th August 2010, 13:59
Sure, you need to modify the gcc parameters: http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

Typically however, you want those warnings, so you use the Q_UNUSED macro to state which are actually unused.

Cruz
20th August 2010, 14:13
To save some research time for the next guy who would ask the same question, put this in your .pro file:

QMAKE_CXXFLAGS_WARN_OFF -= -Wunused-parameter