Try
... = -Wno-unused-parameter
Please see here for details.
Or try
QMAKE_CXXFLAGS_WARN_OFF -= -Wunused-parameter
Note the -
in front of the =
.
Question
I added this to my .pro
file but I stil get warnings :
QMAKE_CXXFLAGS_WARN_OFF = -Wunused-parameter
Solution 2
Try
... = -Wno-unused-parameter
Please see here for details.
Or try
QMAKE_CXXFLAGS_WARN_OFF -= -Wunused-parameter
Note the -
in front of the =
.
OTHER TIPS
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.
I have tried all the following combinations in the .PRO file, and nothing works:
macx: {
QMAKE_CFLAGS += -Wno-unused-parameter
QMAKE_CFLAGS -= -Wunused-parameter
QMAKE_CXXFLAGS += -Wno-unused-parameter
QMAKE_CXXFLAGS -= -Wunused-parameter
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter
QMAKE_CXXFLAGS_WARN_ON -= -Wunused-parameter
QMAKE_CXXFLAGS_WARN_OFF += -Wunused-parameter
QMAKE_CXXFLAGS_WARN_OFF -= -Wno-unused-parameter
}
I'm using Qt 5.14. Does anyone have a suggestion on how to suppress specific warnings?
Note: I'm not interested in this warning specifically, it's just an example. There are other warnings I wish to suppress for the moment.