mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
include/pthread : initialize wait_count in PTHREAD_COND_INITIALIZER
struct pthread_cond_s contains three fields: sem, clockid, and wait_count. However, PTHREAD_COND_INITIALIZER only initialized the first two fields, which triggers -Wmissing-field-initializers when a condition variable is statically initialized. Initialize wait_count explicitly to zero so the macro matches the structure definition and remains warning-free with strict compiler flags. Validated with a minimal compile test using: pthread_cond_t cond = PTHREAD_COND_INITIALIZER; Signed-off-by: nicolasWDC <nicolasWDC@users.noreply.github.com>
This commit is contained in:
parent
1b600bd282
commit
dc830cefdd
1 changed files with 1 additions and 1 deletions
|
|
@ -279,7 +279,7 @@ typedef struct pthread_cond_s pthread_cond_t;
|
|||
# define __PTHREAD_COND_T_DEFINED 1
|
||||
#endif
|
||||
|
||||
#define PTHREAD_COND_INITIALIZER {SEM_INITIALIZER(0), CLOCK_REALTIME }
|
||||
#define PTHREAD_COND_INITIALIZER {SEM_INITIALIZER(0), CLOCK_REALTIME, 0}
|
||||
|
||||
struct pthread_mutexattr_s
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue