From 4c0e9f14183dcbcb4e558aeb3b50472344127ba1 Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Thu, 1 Feb 2024 19:45:04 +0100 Subject: Make two 1-bit fields unsigned This should be a completely harmless warning as we only check whether the fields are true or false. Closes #40911. --- changes/bug40911 | 5 +++++ src/core/or/half_edge_st.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changes/bug40911 diff --git a/changes/bug40911 b/changes/bug40911 new file mode 100644 index 0000000000..c938b56225 --- /dev/null +++ b/changes/bug40911 @@ -0,0 +1,5 @@ + o Minor bugfixes (compiler warnings): + - Make sure the two bitfields in the half-closed edge struct are + unsigned, as we're using them for boolean values and assign 1 to + them. Fixes bug 40911; bugfix on 0.4.7.2-alpha. + diff --git a/src/core/or/half_edge_st.h b/src/core/or/half_edge_st.h index 642d8e1ea5..d8c183a93c 100644 --- a/src/core/or/half_edge_st.h +++ b/src/core/or/half_edge_st.h @@ -41,10 +41,10 @@ typedef struct half_edge_t { /** * Did this edge use congestion control? If so, use * timer instead of pending data approach */ - int used_ccontrol : 1; + unsigned int used_ccontrol : 1; /** Is there a connected cell pending? */ - int connected_pending : 1; + unsigned int connected_pending : 1; } half_edge_t; #endif /* !defined(HALF_EDGE_ST_H) */ -- cgit v1.2.3-54-g00ecf