QMAKE_CXXFLAGS_WARN_OFF - still getting warnings
-
After adding QMAKE_CXXFLAGS_WARN_OFF in all of mine .pro files I am still getting GCC warnings of unused variables.
What did I do wrong ?
QMAKE_CXXFLAGS += -v
QMAKE_CXXFLAGS_WARN_OFF -
@AnneRanch said in QMAKE_CXXFLAGS_WARN_OFF - still getting warnings:
QMAKE_CXXFLAGS_WARN_OFF
Although I have not tried any of this, I am not sure that is correct in itself. I think you are supposed to set that to a value, such as
QMAKE_CXXFLAGS_WARN_OFF -= -Wno-unused-parameter
orQMAKE_CXXFLAGS_WARN_OFF -= -Wall
.Having said that, I think you should read through, say, https://stackoverflow.com/questions/18667291/disable-wall-compiler-warnings-in-a-qt-project, or https://stackoverflow.com/questions/22129383/removing-unused-parameters-warning-in-qtcreator and others
-
Use
CONFIG += warn_off
in your .pro file to disable warnings. This will make sure the compiler is called with all the flags set inQMAKE_CXXFLAGS_WARN_OFF
(which should be automatically set by the default mkspecs, so usually no reason to change it). -
@kkoehne said in QMAKE_CXXFLAGS_WARN_OFF - still getting warnings:
Use
CONFIG += warn_off
in your .pro fileWhich is what the answers in the mentioned https://stackoverflow.com/questions/18667291/disable-wall-compiler-warnings-in-a-qt-project suggest.
-
In an essence - simple GCC -w option to remove ALL warnings is turned into convoluted set of guessing instructions.
For example " remove most warning" is just introducing another level of guessing how "most" is determined.
I am not sure why it is so difficult for coders to post instruction such as
QMAKE_CXXFLAGS_WARN_OFF whic to non -English native clearly reads
"turn it off " and no additional instruction should be necessary.
So in KISS principle - I used an option which by itself does nothing, hence committed no crime.Case closed.
Let's keep coding....