[Bug c++/68230] Unused function parameters not reported by -Wunused-parameter when only used recursively.

j.fisher at digipen dot edu gcc-bugzilla@gcc.gnu.org
Thu Sep 28 17:51:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68230

--- Comment #5 from Joshua T, Fisher <j.fisher at digipen dot edu> ---
(In reply to Jonathan Wakely from comment #2)
> It's rare that my reaction to a -Wunused-parameter warning is to change the
> function to remove the parameter entirely. YMMV.

Totally reasonable, I too rarely change the signature and use either
attributes, removing the parameter name, or the void cast trick. However I have
seen bugs pop up a couple times from important parameters being included, but
not used, see:

https://github.com/nvpro-pipeline/VkHLF/commit/b6646c4773e8aef49c40e8684eca1382bf2e9d50

and my blog where I first encountered this in a closed source codebase:

http://www.nullterminatedstrings.com/c++/recursive-warning

Perhaps this doesn't qualify as a bug in the current -Wunused-parameter warning
implementation, but would it be reasonable to add it as a separate warning?

Thanks for looking into this by the way folks!


More information about the Gcc-bugs mailing list