I am intentionally using a category to override a method that I know is already implemented on a primary class. I know this is typically a sign of weak design-- please, no lectures-- but I can't subclass cleanly in this case. I know swizzling may also be an option.
But for right now, how can I suppress this warning? llvm throws a compiler warning that I can disable (diagnostic ignored "-Wobjc-protocol-method-implementation"
). But then the linker also complains.
This asks a similar question but was looking for a different answer. How can I tell the linker not to complain?
Thanks.
Unfortunately, there's no good answer.
The only linker-based solution is to pass -Wl,-w
at link time; that is, tell Clang to pass the -w
option through to the linker. This will suppress all linker warnings, potentially including ones you'd still like to see.
A higher-level workaround is to pipe the linker's output through grep -v
. The details of that solution would tend to depend heavily on your shell and your build system.
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