Skip to content

Commit cf3cc8f

Browse files
keith-packardnashif
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 <[email protected]>
1 parent 90f766e commit cf3cc8f

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)