Issue
-Wall -Werror
are already set.
I need to add some flag to make unused-s not error but warning. -Wno-unused
discards warnings at all. I want to see warning and succeed compilation. How?
I tried: -Werror=no-unused
but it does not work. GCC 9.
Solution
From the GCC manual:
-Werror=
Make the specified warning into an error. The specifier for a warning is appended; for example
-Werror=switch
turns the warnings controlled by-Wswitch
into errors. This switch takes a negative form, to be used to negate-Werror
for specific warnings; for example-Wno-error=switch
makes-Wswitch
warnings not be errors, even when-Werror
is in effect.
So the option you want to pass is -Wno-error=unused
.
Answered By - Ruslan