[cfe-dev] Applicability of -Wunused-param

George Karpenkov via cfe-dev cfe-dev at lists.llvm.org
Mon Sep 17 18:40:37 PDT 2018


Many projects, including LLVM have to turn -Wunused-param off, as it has too many false positives.

Most false positives stem from the fact that often a function has to take a parameter not because it wants to, but because:

1. It’s part of an interface, and has to be API/ABI compatible
2. It overrides another function which does need that parameter

 However, this warning is still very useful when the function is:

 - static 
 - private
 - in an anonymous namespace

This asks for a warning on unused parameters which is restricted to “private" (static local / etc) functions.
Am I missing something there?
Has anyone tried to implement such a warning before?


More information about the cfe-dev mailing list