I am compiling a 3rd party library and don't care to fix the warnings present in the library, but I don't want them polluting the Issues pane in Qt Creator.
I've tried following the advice here, but there is no compiler flag to disable -Wall after it has been enabled, such as with -Wno-enum-compare.
After reading this, I tried removing the flag like so:
CFLAGS -= -Wall
But that didn't work either. So I tried this advice:
QMAKE_CXXFLAGS_WARN_OFF -= -Wall
Still nothing.
So I looked in the generated Makefile and found this:
CFLAGS = -pipe -g -fPIC -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -pipe -g -fPIC -Wall -W -D_REENTRANT $(DEFINES)
So I tried removing the flag from those two variables:
CFLAGS -= -Wall
CXXFLAGS -= -Wall
Still nothing. How are you supposed to remove this compiler flag?!
The simplest solution is:
Thanks to peppe in comments.
Explanation
The
-Wallflag gets inserted into theMakefileby these two variables:So to remove
-Wall, you need to remove it from both of those variables.warn_offdoes just that.