Re: [PATCH v2] tracing: Make is_signed_type() compatible with sparse
From: Vincent Mailhol
Date: Thu Sep 03 2026 - 17:51:59 EST
On 02/09/2026 at 01:25, Steven Rostedt wrote:
> On Tue, 1 Sep 2026 14:56:01 -0700
> Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
>>
>> In contrast, the existing macro is *not* garbage. It just says "does
>> casting -1 end up being larger than casting 1". Admittedly it *should*
>> cast 0, but then compilers are unhappy about comparing unsigned values
>
> It originally did but was changed to 1 for exactly that reason [1].
I removed gcc's -Wtype-limits in commit 660e899103e2 ("kbuild: remove
gcc's -Wtype-limits"). d2802d0739dcc can probably be reverted.
>> against zero, so it's not great, but it's *simple*. It still gives
>> random results for 'bool', I guess, but is bool signed? I don't know,
>> I don't care.
>
> Yeah, it was originally used for the tracing format files so that
> tooling can know how to display the raw values it parses. Also it is
> used for the filtering logic to know how to compare to the raw values.
>
> I see is_signed_type() has picked up some use cases outside of tracing,
> so I'm not sure how much those other areas care about things like
> "bool".
>
> -- Steve
>
>
> [1] d2802d0739dcc ("tracing: Compare to 1 instead of zero for is_signed_type()")
Yours sincerely,
Vincent Mailhol