[LLVMdev] Any objections to turning on -Wunused-parameter? (and any other -Wunused-* that are off?)

Chandler Carruth chandlerc at gmail.com
Sat Jul 18 02:48:51 PDT 2015


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?

(I'll ask the same question and ofter to either enact the cleanups or
toggle the warning(s) back off for each of the less intertwined subprojects
like LLD, LLDB, Polly, etc.)

-Chandler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150718/605a59a1/attachment.html>


More information about the llvm-dev mailing list