[PATCH] D116778: [clang-tidy][clang] Don't trigger unused-parameter warnings on naked functions

Tommaso Bonvicini via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 14 13:39:10 PST 2022


MuAlphaOmegaEpsilon added a comment.

The warning would be correct if the compiler could actually tell the parameter is unused, but at the moment it cannot, as far as I know.

I stumbled upon this thing myself, and there are a few ways to silence the warning:
-removing names
-marking every single parameter as unused

The first one makes the function less readable, and forces me to add extra declarations or documentation to explain to the user the purpose of each parameter.

The second one is quite cumbersome to implement and it clutters the code quite a bit.

I consider these as sub-optimal scenarios, given that whatever I choose I only get drawbacks in order to silence a warning that I think shouldn't really be there in the first place. :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116778/new/

https://reviews.llvm.org/D116778



More information about the cfe-commits mailing list