[LTP] [PATCH 1/1] tst_test.h: Turn 1 bit tst_test members to unsigned

Petr Vorel pvorel@suse.cz
Mon May 6 22:06:00 CEST 2024


This fixes clang warning:

    test22.c:33:17: warning: implicit truncation from 'int' to a one-bit
    wide bit-field changes value from 1 to -1
    [-Wsingle-bit-bitfield-constant-conversion]

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/tst_test.h | 40 ++++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/include/tst_test.h b/include/tst_test.h
index be09bce27..69587917f 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -476,26 +476,26 @@ struct tst_ulimit_val {
 
 	const char *tconf_msg;
 
-	int needs_tmpdir:1;
-	int needs_root:1;
-	int forks_child:1;
-	int needs_device:1;
-	int needs_checkpoints:1;
-	int needs_overlay:1;
-	int format_device:1;
-	int mount_device:1;
-	int needs_rofs:1;
-	int child_needs_reinit:1;
-	int needs_devfs:1;
-	int restore_wallclock:1;
-
-	int all_filesystems:1;
-
-	int skip_in_lockdown:1;
-	int skip_in_secureboot:1;
-	int skip_in_compat:1;
-
-	int needs_hugetlbfs:1;
+	unsigned int needs_tmpdir:1;
+	unsigned int needs_root:1;
+	unsigned int forks_child:1;
+	unsigned int needs_device:1;
+	unsigned int needs_checkpoints:1;
+	unsigned int needs_overlay:1;
+	unsigned int format_device:1;
+	unsigned int mount_device:1;
+	unsigned int needs_rofs:1;
+	unsigned int child_needs_reinit:1;
+	unsigned int needs_devfs:1;
+	unsigned int restore_wallclock:1;
+
+	unsigned int all_filesystems:1;
+
+	unsigned int skip_in_lockdown:1;
+	unsigned int skip_in_secureboot:1;
+	unsigned int skip_in_compat:1;
+
+	unsigned int needs_hugetlbfs:1;
 
 	const char *const *skip_filesystems;
 
-- 
2.43.0



More information about the ltp mailing list