On Fri, 19 Dec 2025 at 08:26, David Laight <[email protected]> wrote:
>
> One possibility is to conditionally add _Pragma()
No. That compiler warning is pure and utter garbage. I have pointed it
out fopr *years*, and compiler people don't get it.
So that warning just needs to die. It's shit. It's wrong.
The sparse patch points out that this *can* be done correctly if you a
compiler person doesn't have their head up their arse.
(And no, I'm not claiming the sparse patch is perfect. I'm only
claiming the sparse patch is _much_ better. Bit tt could be better
still, and there could be other valid cases that could be warned for).
The "warn on type limits" is idiotic. It expects programmers to have
to always track what the exact type limits are, instead of just
writing safe and obvious code, and it warns about *good* code and.
It's exactly the *wrong* kind of thing to warn about.
Linus