Skip to content

Commit 0ba8614

Browse files
keith-packardduynguyenxa
authored andcommitted
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 <keithp@keithp.com>
1 parent a75f5fa commit 0ba8614

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/posix/options/posix_internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ struct posix_thread {
6868

6969
struct posix_condattr {
7070
/* leaves room for CLOCK_REALTIME (1, default) and CLOCK_MONOTONIC (4) */
71-
unsigned int clock: 3;
72-
bool initialized: 1;
71+
unsigned char clock: 3;
72+
char initialized: 1;
7373
#ifdef _POSIX_THREAD_PROCESS_SHARED
74-
unsigned int pshared: 1;
74+
unsigned char pshared: 1;
7575
#endif
7676
};
7777

0 commit comments

Comments
 (0)