removing -Wused-but-marked-unused

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

removing -Wused-but-marked-unused

Fangrui Song via cfe-dev
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 mentions of this flag reveals that 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.

Thoughts?

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: removing -Wused-but-marked-unused

Fangrui Song via cfe-dev
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.

Joerg
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev