Re: [PATCH v2] tracing: Make is_signed_type() compatible with sparse

From: Bart Van Assche

Date: Mon Aug 31 2026 - 17:27:02 EST


On 8/31/26 1:44 PM, David Laight wrote:
On Fri, 7 Aug 2026 10:00:56 -0700
Bart Van Assche <bvanassche@xxxxxxx> wrote:

Using a __bitwise type in a tracing __field() definition triggers four
sparse warnings in stage 4 of expanding the TRACE_EVENT() macro. These
warnings are triggered by the is_signed_type() macro implementation.
Fix this by using _Generic() in the is_signed_type() implementation
instead of an integer comparison.

Does adding __force to the LH cast remove the warning?
Is so that would be a much better fix.
I have tried this, but unfortunately this doesn't suppress the sparse
complaints about the casts in the is_signed_type() implementation.

Thanks,

Bart.