[Intel-wired-lan] [PATCH 000/141] Fix fall-through warnings for Clang

Miguel Ojeda miguel.ojeda.sandonis at gmail.com
Thu Nov 26 17:05:45 UTC 2020


On Thu, Nov 26, 2020 at 4:28 PM Geert Uytterhoeven <geert at linux-m68k.org> wrote:
>
> The maintainer is not necessarily the owner/author of the code, and
> thus may not know the intent of the code.

Agreed, I was not blaming maintainers -- just trying to point out that
the problem is there :-)

In those cases, it is still very useful: we add the `fallthrough` and
a comment saying `FIXME: fallthrough intended? Figure this out...`.
Thus a previous unknown unknown is now a known unknown. And no new
unknown unknowns will be introduced since we enabled the warning
globally.

> BTW, you cannot mindlessly fix the latter, as you cannot know if
> "(a == b)" or "((a = b))" was intended, without understanding the code
> (and the (possibly unavailable) data sheet, and the hardware, ...).

That's right, I was referring to the cases where the compiler saves
someone time from a typo they just made.

Cheers,
Miguel


More information about the Intel-wired-lan mailing list