When -Wused-but-marked-unused was added 10 (!) years ago, John pointed out that this breaks idiomatic usage of __attribute__((unused)). It did then, and it still does today; searching for mentionsofthisflagrevealsthat by and large the only time people mention it is to turn it off or complain about it.
At the time it was added, John also implicitly asked why anyone would ever want this warning, and that question went unanswered at the time. So I'm going to ask it again: does anyone want this warning (even though it breaks the documented intent (note: "possibly unused") of __attribute__((unused)) for -Werror builds) -- and if so, why?
If we can't establish a rationale for this warning existing, I suggest we remove it.
On Mon, May 11, 2020 at 03:21:51PM -0700, Richard Smith via cfe-dev wrote:
> If we can't establish a rationale for this warning existing, I suggest we
> remove it.
I think it can be useful in combination with -Wno-error to check for
left-overs from old asserts. E.g. it is a common idiom to mark variables
with used if they are only referenced in asserts, so it would be nice to
still have a way to find extras.