mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] compiler.h: Support 64-bit bitwise types in is_signed_type()
@ 2026-11-16 22:26 Bart Van Assche
  2026-11-17  8:06 ` David Laight
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Van Assche @ 2026-11-16 22:26 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: linux-kernel, Christoph Hellwig, Linus Torvalds, David Laight,
	Bart Van Assche

Replace -1 with -1LL in the definition of is_signed_type(type) to
prevent sparse from emitting "cast to restricted __le64" and
"restricted __le64 degrades to integer" warnings when evaluating
is_signed_type() on 64-bit __bitwise types such as __le64 (for example,
in tracepoint __field() macros in net/mac80211/trace.h).

Use a 64-bit all-ones constant (-1LL) rather than a 32-bit int (-1)
because sparse only permits casting a non-zero integer constant to a
__bitwise type and ordering it with '<' when the constant has all bits
set across the full bit width of the target type. Ensure that the
constant before the cast has 64 bits set so that sparse's
restricted_value() and can_order() checks succeed for 64-bit __bitwise
types on both 32-bit and 64-bit architectures.

Add a KUnit test case for is_signed_type(__le64) in
lib/tests/is_signed_type_kunit.c to exercise 64-bit __bitwise types.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 include/linux/compiler.h         | 2 +-
 lib/tests/is_signed_type_kunit.c | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index cb2f6050bdf7..2f133a7c3885 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -326,7 +326,7 @@ static inline void *offset_to_ptr(const int *off)
  * Whether 'type' is a signed type or an unsigned type. Supports scalar types,
  * bool and also pointer types.
  */
-#define is_signed_type(type) (((type)(-1)) < (__force type)1)
+#define is_signed_type(type) (((type)(-1LL)) < (__force type)1)
 #define is_unsigned_type(type) (!is_signed_type(type))
 
 /*
diff --git a/lib/tests/is_signed_type_kunit.c b/lib/tests/is_signed_type_kunit.c
index 88adbe813f3a..b9c8f7da45e9 100644
--- a/lib/tests/is_signed_type_kunit.c
+++ b/lib/tests/is_signed_type_kunit.c
@@ -18,6 +18,8 @@ enum signed_enum {
 
 static void is_signed_type_test(struct kunit *test)
 {
+	typedef __bitwise long long bitwise_long_long;
+
 	KUNIT_EXPECT_EQ(test, is_signed_type(bool), false);
 	KUNIT_EXPECT_EQ(test, is_signed_type(signed char), true);
 	KUNIT_EXPECT_EQ(test, is_signed_type(unsigned char), false);
@@ -27,7 +29,10 @@ static void is_signed_type_test(struct kunit *test)
 	KUNIT_EXPECT_EQ(test, is_signed_type(long), true);
 	KUNIT_EXPECT_EQ(test, is_signed_type(unsigned long), false);
 	KUNIT_EXPECT_EQ(test, is_signed_type(long long), true);
+	KUNIT_EXPECT_EQ(test, is_signed_type(bitwise_long_long), true);
 	KUNIT_EXPECT_EQ(test, is_signed_type(unsigned long long), false);
+	KUNIT_EXPECT_EQ(test, is_signed_type(__be64), false);
+	KUNIT_EXPECT_EQ(test, is_signed_type(__le64), false);
 	KUNIT_EXPECT_EQ(test, is_signed_type(enum unsigned_enum), false);
 	KUNIT_EXPECT_EQ(test, is_signed_type(enum signed_enum), true);
 	KUNIT_EXPECT_EQ(test, is_signed_type(void *), false);

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] compiler.h: Support 64-bit bitwise types in is_signed_type()
  2026-11-16 22:26 [PATCH] compiler.h: Support 64-bit bitwise types in is_signed_type() Bart Van Assche
@ 2026-11-17  8:06 ` David Laight
  2026-11-17 16:32   ` Bart Van Assche
  0 siblings, 1 reply; 7+ messages in thread
From: David Laight @ 2026-11-17  8:06 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Steven Rostedt, linux-kernel, Christoph Hellwig, Linus Torvalds

On Mon, 16 Nov 2026 14:26:25 -0800
Bart Van Assche <bvanassche@acm.org> wrote:

> Replace -1 with -1LL in the definition of is_signed_type(type) to
> prevent sparse from emitting "cast to restricted __le64" and
> "restricted __le64 degrades to integer" warnings when evaluating
> is_signed_type() on 64-bit __bitwise types such as __le64 (for example,
> in tracepoint __field() macros in net/mac80211/trace.h).

Don't the trace definitions need fixing?
The trace code prints the numeric value so you really want a host
ordered value in the trace record.

An alternative view is that even asking the question 'is_signed_type'
of a bitwise variable makes no sense.

David

> 
> Use a 64-bit all-ones constant (-1LL) rather than a 32-bit int (-1)
> because sparse only permits casting a non-zero integer constant to a
> __bitwise type and ordering it with '<' when the constant has all bits
> set across the full bit width of the target type. Ensure that the
> constant before the cast has 64 bits set so that sparse's
> restricted_value() and can_order() checks succeed for 64-bit __bitwise
> types on both 32-bit and 64-bit architectures.
> 
> Add a KUnit test case for is_signed_type(__le64) in
> lib/tests/is_signed_type_kunit.c to exercise 64-bit __bitwise types.
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  include/linux/compiler.h         | 2 +-
>  lib/tests/is_signed_type_kunit.c | 5 +++++
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/compiler.h b/include/linux/compiler.h
> index cb2f6050bdf7..2f133a7c3885 100644
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -326,7 +326,7 @@ static inline void *offset_to_ptr(const int *off)
>   * Whether 'type' is a signed type or an unsigned type. Supports scalar types,
>   * bool and also pointer types.
>   */
> -#define is_signed_type(type) (((type)(-1)) < (__force type)1)
> +#define is_signed_type(type) (((type)(-1LL)) < (__force type)1)
>  #define is_unsigned_type(type) (!is_signed_type(type))
>  
>  /*
> diff --git a/lib/tests/is_signed_type_kunit.c b/lib/tests/is_signed_type_kunit.c
> index 88adbe813f3a..b9c8f7da45e9 100644
> --- a/lib/tests/is_signed_type_kunit.c
> +++ b/lib/tests/is_signed_type_kunit.c
> @@ -18,6 +18,8 @@ enum signed_enum {
>  
>  static void is_signed_type_test(struct kunit *test)
>  {
> +	typedef __bitwise long long bitwise_long_long;
> +
>  	KUNIT_EXPECT_EQ(test, is_signed_type(bool), false);
>  	KUNIT_EXPECT_EQ(test, is_signed_type(signed char), true);
>  	KUNIT_EXPECT_EQ(test, is_signed_type(unsigned char), false);
> @@ -27,7 +29,10 @@ static void is_signed_type_test(struct kunit *test)
>  	KUNIT_EXPECT_EQ(test, is_signed_type(long), true);
>  	KUNIT_EXPECT_EQ(test, is_signed_type(unsigned long), false);
>  	KUNIT_EXPECT_EQ(test, is_signed_type(long long), true);
> +	KUNIT_EXPECT_EQ(test, is_signed_type(bitwise_long_long), true);
>  	KUNIT_EXPECT_EQ(test, is_signed_type(unsigned long long), false);
> +	KUNIT_EXPECT_EQ(test, is_signed_type(__be64), false);
> +	KUNIT_EXPECT_EQ(test, is_signed_type(__le64), false);
>  	KUNIT_EXPECT_EQ(test, is_signed_type(enum unsigned_enum), false);
>  	KUNIT_EXPECT_EQ(test, is_signed_type(enum signed_enum), true);
>  	KUNIT_EXPECT_EQ(test, is_signed_type(void *), false);


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] compiler.h: Support 64-bit bitwise types in is_signed_type()
  2026-11-17  8:06 ` David Laight
@ 2026-11-17 16:32   ` Bart Van Assche
  2026-11-18 12:13     ` David Laight
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Van Assche @ 2026-11-17 16:32 UTC (permalink / raw)
  To: David Laight
  Cc: Steven Rostedt, linux-kernel, Christoph Hellwig, Linus Torvalds

On 11/17/26 12:06 AM, David Laight wrote:
> Don't the trace definitions need fixing?
> The trace code prints the numeric value so you really want a host
> ordered value in the trace record.
> 
> An alternative view is that even asking the question 'is_signed_type'
> of a bitwise variable makes no sense.
Are you perhaps suggesting that we should tell ftrace users that it is
no longer allowed to declare __le64 fields, something they probably
would not consider reasonable? Please let me know if I misunderstood
your question. Below is an incomplete overview of the examples of __le64
tracing fields (__le64 typedefs have been ignored):

$ git grep -nHF '__field(__le64'
net/ieee802154/trace.h:74:		__field(__le64, extended_addr)
net/ieee802154/trace.h:367:		__field(__le64, addr)
net/ieee802154/trace.h:386:		__field(__le64, addr)
net/mac80211/trace.h:2507:		__field(__le64, twt)
net/mac802154/trace.h:191:		__field(__le64, extended_addr)
net/mac802154/trace.h:272:		__field(__le64, addr)

Thanks,

Bart.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] compiler.h: Support 64-bit bitwise types in is_signed_type()
  2026-11-17 16:32   ` Bart Van Assche
@ 2026-11-18 12:13     ` David Laight
  2026-11-19 18:27       ` Linus Torvalds
  0 siblings, 1 reply; 7+ messages in thread
From: David Laight @ 2026-11-18 12:13 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Steven Rostedt, linux-kernel, Christoph Hellwig, Linus Torvalds

On Tue, 17 Nov 2026 08:32:11 -0800
Bart Van Assche <bvanassche@acm.org> wrote:

> On 11/17/26 12:06 AM, David Laight wrote:
> > Don't the trace definitions need fixing?
> > The trace code prints the numeric value so you really want a host
> > ordered value in the trace record.
> > 
> > An alternative view is that even asking the question 'is_signed_type'
> > of a bitwise variable makes no sense.  
> Are you perhaps suggesting that we should tell ftrace users that it is
> no longer allowed to declare __le64 fields, something they probably
> would not consider reasonable? Please let me know if I misunderstood
> your question. Below is an incomplete overview of the examples of __le64
> tracing fields (__le64 typedefs have been ignored):
> 
> $ git grep -nHF '__field(__le64'
> net/ieee802154/trace.h:74:		__field(__le64, extended_addr)
> net/ieee802154/trace.h:367:		__field(__le64, addr)
> net/ieee802154/trace.h:386:		__field(__le64, addr)
> net/mac80211/trace.h:2507:		__field(__le64, twt)
> net/mac802154/trace.h:191:		__field(__le64, extended_addr)
> net/mac802154/trace.h:272:		__field(__le64, addr)

The fields ought to be u64 - since that is how they are printed.
So the copy should either contain an lexxtoh() or a 'force' cast.
The same is really true for le16 and le32.

David

> 
> Thanks,
> 
> Bart.
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] compiler.h: Support 64-bit bitwise types in is_signed_type()
  2026-11-18 12:13     ` David Laight
@ 2026-11-19 18:27       ` Linus Torvalds
  2026-11-19 23:14         ` David Laight
  0 siblings, 1 reply; 7+ messages in thread
From: Linus Torvalds @ 2026-11-19 18:27 UTC (permalink / raw)
  To: David Laight
  Cc: Bart Van Assche, Steven Rostedt, linux-kernel, Christoph Hellwig

On Wed, 18 Nov 2026 at 04:13, David Laight <david.laight.linux@gmail.com> wrote:
>
> The fields ought to be u64 - since that is how they are printed.

... but then the actual tracing side would be worse and either require
a stupid and incorrect cast, or actual work to turn it into host byte
order.

So clearly the printing side doesn't understand about byte order, but
that's a printing side issue (that nobody really cares abnout:
big-endian is dead, and good riddance).

That said: I think the right fix might actually be to just allow sign
extension of the constants 0/-1 inside sparse for bitwise types.

So the sparse warning "cast to restricted __le64" should just be
suppressed for the values that bitwise types already accept (all ones
and all zeroes).

Because all ones and all zeroes are by definition fine in bitwise
types. Bit orderign and meaning doesn't matter when all bits are
equal.

             Linus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] compiler.h: Support 64-bit bitwise types in is_signed_type()
  2026-11-19 18:27       ` Linus Torvalds
@ 2026-11-19 23:14         ` David Laight
  2026-11-26 14:15           ` Bart Van Assche
  0 siblings, 1 reply; 7+ messages in thread
From: David Laight @ 2026-11-19 23:14 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Bart Van Assche, Steven Rostedt, linux-kernel, Christoph Hellwig

On Thu, 19 Nov 2026 10:27:38 -0800
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Wed, 18 Nov 2026 at 04:13, David Laight <david.laight.linux@gmail.com> wrote:
> >
> > The fields ought to be u64 - since that is how they are printed.  
> 
> ... but then the actual tracing side would be worse and either require
> a stupid and incorrect cast, or actual work to turn it into host byte
> order.
> 
> So clearly the printing side doesn't understand about byte order, but
> that's a printing side issue (that nobody really cares abnout:
> big-endian is dead, and good riddance).
> 
> That said: I think the right fix might actually be to just allow sign
> extension of the constants 0/-1 inside sparse for bitwise types.
> 
> So the sparse warning "cast to restricted __le64" should just be
> suppressed for the values that bitwise types already accept (all ones
> and all zeroes).

I guess if sparse is going to allow the cast at all, it should sign
extend the -1 first - the same as the compiler does.

David

> Because all ones and all zeroes are by definition fine in bitwise
> types. Bit orderign and meaning doesn't matter when all bits are
> equal.
> 
>              Linus


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] compiler.h: Support 64-bit bitwise types in is_signed_type()
  2026-11-19 23:14         ` David Laight
@ 2026-11-26 14:15           ` Bart Van Assche
  0 siblings, 0 replies; 7+ messages in thread
From: Bart Van Assche @ 2026-11-26 14:15 UTC (permalink / raw)
  To: David Laight, Linus Torvalds
  Cc: Steven Rostedt, linux-kernel, Christoph Hellwig

On 11/19/26 3:14 PM, David Laight wrote:
> On Thu, 19 Nov 2026 10:27:38 -0800
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
>> On Wed, 18 Nov 2026 at 04:13, David Laight <david.laight.linux@gmail.com> wrote:
>>>
>>> The fields ought to be u64 - since that is how they are printed.
>>
>> ... but then the actual tracing side would be worse and either require
>> a stupid and incorrect cast, or actual work to turn it into host byte
>> order.
>>
>> So clearly the printing side doesn't understand about byte order, but
>> that's a printing side issue (that nobody really cares abnout:
>> big-endian is dead, and good riddance).
>>
>> That said: I think the right fix might actually be to just allow sign
>> extension of the constants 0/-1 inside sparse for bitwise types.
>>
>> So the sparse warning "cast to restricted __le64" should just be
>> suppressed for the values that bitwise types already accept (all ones
>> and all zeroes).
> 
> I guess if sparse is going to allow the cast at all, it should sign
> extend the -1 first - the same as the compiler does.

If nobody object I will apply the patch below on the sparse codebase.

Thanks,

Bart.


[PATCH] bitwise: Allow constant ordered compares for signed
  restricted types

Allow ordered comparisons for a signed bitwise type if both operands
are integer constant expressions and at least one of them is an
unrestricted value (all zeroes or all ones). Stop reporting "degrades
to integer" for the Linux kernel is_signed_type() macro when it is
applied to a signed bitwise type.

Keep warning about ordered comparisons between a non-constant signed
bitwise value and zero because the position of the sign bit of such a
value depends on the byte order.

Document the purpose of is_unsigned_restricted_or_int() and
restricted_value() since can_order() relies on both.

Extend validation/bitwise-all-bits-and-casts.c with signed ordered
compares and with is_signed_type() tests.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
  evaluate.c                              | 32 +++++++++-
  validation/bitwise-all-bits-and-casts.c | 81 ++++++++++++++++++++-----
  2 files changed, 95 insertions(+), 18 deletions(-)

diff --git a/evaluate.c b/evaluate.c
index 927c4f35d831..97bfdaa0c769 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -484,6 +484,13 @@ static struct symbol *bad_expr_type(struct 
expression *expr)
  	return expr->ctype = &bad_ctype;
  }

+/*
+ * Check whether @sym is an unsigned integer type. A bitwise type is not an
+ * integer type itself but a SYM_RESTRICT symbol on top of an integer type.
+ * Hence look through the node, enum, bitwise, fouled and bitfield 
layers and
+ * report whether any of these layers or the underlying type is unsigned.
+ * Returns false for signed integer types and for non-integer types.
+ */
  static bool is_unsigned_restricted_or_int(struct symbol *sym)
  {
  	while (sym) {
@@ -500,6 +507,21 @@ static bool is_unsigned_restricted_or_int(struct 
symbol *sym)
  	return sym && (sym->ctype.modifiers & MOD_UNSIGNED);
  }

+/*
+ * Check whether @v must be treated as a restricted value with respect 
to the
+ * bitwise type @type. Returns 0 if @v is an unrestricted value, that is, a
+ * value that may be mixed freely with @type because its meaning does not
+ * depend on the bit or byte order, and 1 otherwise. The unrestricted 
values
+ * are:
+ * - The constant zero.
+ * - A constant that has all bits set in @type, either after it has been
+ *   extended according to its own signedness (-1, ~0) or after it has been
+ *   truncated (~0U for a 16-bit type). ~0U is restricted for a 64-bit type
+ *   since zero extension does not set the upper bits.
+ * - A regular or forced cast to an integer or bitwise type of one of the
+ *   above, except a nonzero value that is cast to an unsigned type that is
+ *   narrower than @type.
+ */
  static int restricted_value(struct expression *v, struct symbol *type)
  {
  	if (v->type == EXPR_CAST || v->type == EXPR_FORCE_CAST) {
@@ -542,12 +564,16 @@ static int restricted_value(struct expression *v, 
struct symbol *type)
  }

  /*
- * Bitwise types can do ordered comparisons with
- * the unrestricted values, but not in general
+ * Bitwise types can do ordered comparisons with the unrestricted 
values (all
+ * zeroes and all ones), but not in general. The sign bit of a signed 
bitwise
+ * type has no well-defined position, hence only allow ordered 
comparisons for
+ * signed bitwise types if both operands are integer constant 
expressions, as
+ * is the case for the Linux kernel is_signed_type() macro.
   */
  static bool can_order(struct symbol *type, struct expression *left, 
struct expression *right)
  {
-	if (!is_unsigned_restricted_or_int(type))
+	if (!is_unsigned_restricted_or_int(type) &&
+	    !(left->flags & right->flags & CEF_ICE))
  		return false;
  	return !restricted_value(left, type) ||
  		!restricted_value(right, type);
diff --git a/validation/bitwise-all-bits-and-casts.c 
b/validation/bitwise-all-bits-and-casts.c
index ae0be1269ec4..b7a322d029ca 100644
--- a/validation/bitwise-all-bits-and-casts.c
+++ b/validation/bitwise-all-bits-and-casts.c
@@ -4,6 +4,7 @@ typedef unsigned long long __attribute__((bitwise)) be64;
  typedef unsigned int __attribute__((bitwise)) be32;
  typedef unsigned short __attribute__((bitwise)) be16;
  typedef signed int __attribute__((bitwise)) sbe32;
+typedef signed long long __attribute__((bitwise)) sbe64;

  static be32 test_all_bits(void)
  {
@@ -63,19 +64,58 @@ static int test_ordered_compare(be32 x, be16 y)
  	return res;
  }

-static void test_bad_narrow_and_signed(sbe32 sx)
+static int test_signed_constant_compare(void)
+{
+	int res = 0;
+	if ((sbe32)-1 < (sbe32)0)
+		res++;
+	if ((sbe64)0 >= (sbe64)~0)
+		res++;
+	if ((__force sbe64)1 > (sbe64)-1)
+		res++;
+	return res;
+}
+
+#define is_signed_type(type) (((type)(-1)) < (__force type)1)
+
+static int test_is_signed_type(void)
+{
+	_Static_assert(!is_signed_type(be16), "be16");
+	_Static_assert(!is_signed_type(be32), "be32");
+	_Static_assert(!is_signed_type(be64), "be64");
+	_Static_assert(is_signed_type(sbe32), "sbe32");
+	_Static_assert(is_signed_type(sbe64), "sbe64");
+
+	return is_signed_type(be64) + is_signed_type(sbe64);
+}
+
+static void test_bad_narrow_and_signed(sbe32 sx, sbe32 sy, sbe64 sz)
  {
  	be64 bad_u32 = ~0U;
  	be32 bad_u16 = (unsigned short)~0;
  	be32 bad_c16 = (be16)~0;
  	be32 bad_f16 = (__force be16)~0;
-	int bad_ord = (sx > 0);
+	int bad_ord = (sx > sy);
+	int bad_val = (sx > 1);
+	int bad_gt0 = (sx > 0);
+	int bad_lt0 = (0 < sx);
+	int bad_m1 = (sx < -1);
+	int bad_ge0 = (sz >= 0);
+	int bad_not0 = (sz < ~0);
+	int bad_cst = ((sbe32)1 < (sbe32)2);

  	(void)bad_u32;
  	(void)bad_u16;
  	(void)bad_c16;
  	(void)bad_f16;
  	(void)bad_ord;
+	(void)bad_val;
+	(void)bad_gt0;
+	(void)bad_lt0;
+	(void)bad_m1;
+	(void)bad_ge0;
+	(void)bad_not0;
+	(void)bad_cst;
  }

  /*
@@ -83,18 +123,29 @@ static void test_bad_narrow_and_signed(sbe32 sx)
   * check-command: sparse -Wbitwise $file
   *
   * check-error-start
-bitwise-all-bits-and-casts.c:68:24: warning: incorrect type in 
initializer (different base types)
-bitwise-all-bits-and-casts.c:68:24:    expected restricted be64 
[usertype] bad_u32
-bitwise-all-bits-and-casts.c:68:24:    got unsigned int
-bitwise-all-bits-and-casts.c:69:25: warning: incorrect type in 
initializer (different base types)
-bitwise-all-bits-and-casts.c:69:25:    expected restricted be32 
[usertype] bad_u16
-bitwise-all-bits-and-casts.c:69:25:    got unsigned short
-bitwise-all-bits-and-casts.c:70:25: warning: incorrect type in 
initializer (different base types)
-bitwise-all-bits-and-casts.c:70:25:    expected restricted be32 
[usertype] bad_c16
-bitwise-all-bits-and-casts.c:70:25:    got restricted be16 [usertype]
-bitwise-all-bits-and-casts.c:71:25: warning: incorrect type in 
initializer (different base types)
-bitwise-all-bits-and-casts.c:71:25:    expected restricted be32 
[usertype] bad_f16
-bitwise-all-bits-and-casts.c:71:25:    got restricted be16 [usertype]
-bitwise-all-bits-and-casts.c:72:24: warning: restricted sbe32 degrades 
to integer
+bitwise-all-bits-and-casts.c:94:24: warning: incorrect type in 
initializer (different base types)
+bitwise-all-bits-and-casts.c:94:24:    expected restricted be64 
[usertype] bad_u32
+bitwise-all-bits-and-casts.c:94:24:    got unsigned int
+bitwise-all-bits-and-casts.c:95:25: warning: incorrect type in 
initializer (different base types)
+bitwise-all-bits-and-casts.c:95:25:    expected restricted be32 
[usertype] bad_u16
+bitwise-all-bits-and-casts.c:95:25:    got unsigned short
+bitwise-all-bits-and-casts.c:96:25: warning: incorrect type in 
initializer (different base types)
+bitwise-all-bits-and-casts.c:96:25:    expected restricted be32 
[usertype] bad_c16
+bitwise-all-bits-and-casts.c:96:25:    got restricted be16 [usertype]
+bitwise-all-bits-and-casts.c:97:25: warning: incorrect type in 
initializer (different base types)
+bitwise-all-bits-and-casts.c:97:25:    expected restricted be32 
[usertype] bad_f16
+bitwise-all-bits-and-casts.c:97:25:    got restricted be16 [usertype]
+bitwise-all-bits-and-casts.c:98:24: warning: restricted sbe32 degrades 
to integer
+bitwise-all-bits-and-casts.c:98:29: warning: restricted sbe32 degrades 
to integer
+bitwise-all-bits-and-casts.c:99:24: warning: restricted sbe32 degrades 
to integer
+bitwise-all-bits-and-casts.c:100:24: warning: restricted sbe32 degrades 
to integer
+bitwise-all-bits-and-casts.c:101:28: warning: restricted sbe32 degrades 
to integer
+bitwise-all-bits-and-casts.c:102:23: warning: restricted sbe32 degrades 
to integer
+bitwise-all-bits-and-casts.c:103:24: warning: restricted sbe64 degrades 
to integer
+bitwise-all-bits-and-casts.c:104:25: warning: restricted sbe64 degrades 
to integer
+bitwise-all-bits-and-casts.c:105:25: warning: cast to restricted sbe32
+bitwise-all-bits-and-casts.c:105:36: warning: cast to restricted sbe32
+bitwise-all-bits-and-casts.c:105:25: warning: restricted sbe32 degrades 
to integer
+bitwise-all-bits-and-casts.c:105:36: warning: restricted sbe32 degrades 
to integer
   * check-error-end
   */


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-26 14:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 22:26 [PATCH] compiler.h: Support 64-bit bitwise types in is_signed_type() Bart Van Assche
2026-11-17  8:06 ` David Laight
2026-11-17 16:32   ` Bart Van Assche
2026-11-18 12:13     ` David Laight
2026-11-19 18:27       ` Linus Torvalds
2026-11-19 23:14         ` David Laight
2026-11-26 14:15           ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®