I have a build configuration that has some "-Wno" options meant to cover both 'gcc' and 'clang'. The problem is that gcc doesn't recognize some of the clang specific ones and fails to compile because of it.
Example of the error:
error: unrecognized command line option "-Wno-self-assign"
Is there a way to tell gcc to ignore command line options that it doesn't recognize?
This is the default for gcc >= 4.4, see https://gcc.gnu.org/gcc-4.4/changes.html
Prior to gcc 4.4, this is not possible to achieve. The suggestion above on -Wno-error=unknown-warning is incorrect, and is possibly a result of misreading the gcc manual (where "unknown-warning" is used as an example for a warning that gcc does not recognize).
It turns out there is a warning unknown-warning
that with -Werror
becomes an error.
This can be disabled with:
-Wno-error=unknown-warning
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With