Solved Suppressing warning "unused parameter". How?
-
Suppressing warning "unused parameter". How?
-
-
@bogong
Without knowing which compiler you are using?If you want to use the Qt macro,
Q_UNUSED(var)
, as per https://doc.qt.io/qt-5/qtglobal.html#Q_UNUSED. -
Got it. Thx. Issue closed.
-
If you're a cool guy, you can comment out the variable name in the function header:
CoolGuyClass::coolFunction(int /*im_useless*/)
-
@qwasder85 : That is how I would do it and wondered, why the MACRO exists. Today I found a use case: If a variable is unused only in release but used in debug build!
I just wanted to share ...