[COMMITTED] elf: Fix tunconf.c build with clang

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Aug 11 13:58:17 GMT 2026


clang enables -Wsingle-bit-bitfield-constant-conversion with -Werror
and it triggers:

tunconf.c:338:32: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
  338 |       entry->value_is_negative = 1;

Change both value_is_negative and value_was_parsed to unsigned.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 elf/tunconf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elf/tunconf.c b/elf/tunconf.c
index c27b50b1de0..d4b2e541b53 100644
--- a/elf/tunconf.c
+++ b/elf/tunconf.c
@@ -66,8 +66,8 @@ struct tunable_entry_int {
   bool exclude_secure:1;
   bool exclude_nonsecure:1;
   int tunable_id;
-  int value_is_negative:1;
-  int value_was_parsed:1;
+  unsigned int value_is_negative:1;
+  unsigned int value_was_parsed:1;
   unsigned long long value_ull;
   signed long long value_sll;
   long filter_flags;
-- 
2.53.0



More information about the Libc-alpha mailing list