Treat specific warnings as errors
use -Werror=
for example:
-Werror=unused-variable
will treat unused variable as error, which originally treat as warning by -Wunused-variable
flag
add these to Other Warning Flags
in project setting.
Treat all warnings as errors except for some warnings
use -Werror
and -Wno-error=
The first one will treat all warnings as errors, equals to the setting in Xcode.
And use -Wno-error=
to make specific warning not be error. For example:
-Wno-error=unused-variable
add these to Other Warning Flags
in project setting.
Reference https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
For all warning flags https://clang.llvm.org/docs/DiagnosticsReference.html