From 717c38f658248bc04ccfc6e7fdf5d03040c2a846 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 14 Dec 2023 10:46:56 -0500 Subject: [PATCH] fix: -Wsingle-bit-bitfield-constant-conversion with clang16 We get the following warning with Clang 16: lttng-ust-abi.c:558:38: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion] lttng_chan_buf->priv->parent.tstate = 1; My understanding is that there is no bug because we only check if the values are zero or not, so we can silence the warning by making the variables unsigned. Change-Id: Ic4e02164d5adf4271fa24e5b13e5d320ae19de2e Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- src/common/events.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/events.h b/src/common/events.h index 0c2d3136..a1450249 100644 --- a/src/common/events.h +++ b/src/common/events.h @@ -343,9 +343,9 @@ struct lttng_ust_session_private { struct lttng_ust_event_ht events_ht; /* ht of events */ void *owner; /* object owner */ - int tstate:1; /* Transient enable state */ + unsigned int tstate:1; /* Transient enable state */ - int statedump_pending:1; + unsigned int statedump_pending:1; struct lttng_ust_enum_ht enums_ht; /* ht of enumerations */ struct cds_list_head enums_head; @@ -393,7 +393,7 @@ struct lttng_ust_channel_common_private { struct lttng_ust_channel_common *pub; /* Public channel interface */ int objd; /* Object associated with channel. */ - int tstate:1; /* Transient enable state */ + unsigned int tstate:1; /* Transient enable state */ }; struct lttng_ust_channel_buffer_private { -- 2.34.1