Removing Unused parameters warning in QtCreator

Youssef Bouhjira picture Youssef Bouhjira · Mar 2, 2014 · Viewed 8.3k times · Source

I added this to my .pro file but I stil get warnings :

QMAKE_CXXFLAGS_WARN_OFF = -Wunused-parameter

Answer

LanhaiYou picture LanhaiYou · Feb 18, 2016

Use QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter,
because the flags in QMAKE_CXX_FLAGS will always before QMAKE_CXXFLAGS_WARN_ON, and QMAKE_CXXFLAGS_WARN_ON contains the flag -Wall. This means your flag will be overwrite by flag -Wall.