[LLVMdev] [cfe-dev] Any objections to turning on -Wunused-parameter? (and any other -Wunused-* that are off?)
Chris Lattner
clattner at apple.com
Sun Jul 19 08:59:18 PDT 2015
> On Jul 18, 2015, at 2:48 AM, Chandler Carruth <chandlerc at gmail.com> wrote:
>
> LLVM and Clang both have lots of objects that are passed through many different API boundaries. Things like AliasAnalysis in LLVM or Sema in Clang get threaded all over the place.
>
> Over times, refactoring can often cause the parameters (or local variables, or member variables, etc) to become dead. If we notice this, we can often un-thread the interface through our APIs, sometimes even reducing coupling, etc.
>
> But currently -Wunused-parameter is hard disabled. I've not checked to see if there are any other disabling of -Wunused-* variants, but I'd like to move the project toward firmly enabling them and being clean with them.
>
> The technique I'd like to use is leaving out names of unused parameters, using a /*CommentedName*/ if there is a useful name, otherwise just omitting the name.
>
> All of this will require a reasonable amount of cleanup across the projects which I'm happy to do prior to flipping defaults around. Thoughts? Any concerns or objections?
+1. We should also consider other general goodness warnings as well.
-Chris
More information about the llvm-dev
mailing list