[PATCH] D61147: [Sema][ObjC] Add a flavor of -Wunused-parameter that doesn't diagnose unused parameters of ObjC methods

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 25 13:53:32 PDT 2019

erik.pilkington added a comment.

> but don't want to annotate each unused ObjC method parameters with `__attribute__((unused))` or insert `(void)unused_param` into the body of the method to silence the warning since, unlike C/C++ functions, it's not possible to comment out the unused parameters of ObjC methods.

Thats also true of function parameters in C (and Objective-C), so I don't think that argument is very convincing. I think it is true that this is a much less useful diagnostic for methods though, because they're more likely to be overriding something that requires a certain selector. Maybe we should just suppress this warning in general for methods (and even virtual functions in C++)?

  rC Clang



More information about the cfe-commits mailing list