Re: [PATCH 16/19] Documentation: rust: add coding guidelines on lints

From: Miguel Ojeda
Date: Thu Sep 05 2024 - 05:47:02 EST


On Thu, Sep 5, 2024 at 10:16 AM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
>
> Wow, does C really not have an easier way to do it?

Yeah, it would be nice to get a similar system in C.

There are targeted attributes that can annotate certain things, like
`[[maybe_unused]]` in C23 (and vendor attributes too like our
`__maybe_unused` macro), so `-Wunused-function` is not really the best
example in that sense -- I will think of a better one (it was nice to
use the same as in the other examples I wrote for `expect` later on,
which is why I used it).

But, as far as I am aware, there is no way to handle lints (and levels
and so on) in a simple and consistent way like Rust does.

Cheers,
Miguel