From 34a03fb4369ae7b1f7b45b48e23d8d7d883ed231 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 12 May 2025 10:44:29 -0400 Subject: [PATCH] posix: Use 'char' for posix_condattr bitfields Ensure that posix_condattr is smaller than pthread_condattr by keeping it under one byte. Signed-off-by: Keith Packard --- lib/posix/options/posix_internal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/posix/options/posix_internal.h b/lib/posix/options/posix_internal.h index 3a4804d0ee4..6fb31dc632e 100644 --- a/lib/posix/options/posix_internal.h +++ b/lib/posix/options/posix_internal.h @@ -68,10 +68,10 @@ struct posix_thread { struct posix_condattr { /* leaves room for CLOCK_REALTIME (1, default) and CLOCK_MONOTONIC (4) */ - unsigned int clock: 3; - bool initialized: 1; + unsigned char clock: 3; + char initialized: 1; #ifdef _POSIX_THREAD_PROCESS_SHARED - unsigned int pshared: 1; + unsigned char pshared: 1; #endif };