Zepp-Hanzj opened a new pull request, #19147:
URL: https://github.com/apache/nuttx/pull/19147

   ## Summary
   
   `PTHREAD_COND_INITIALIZER` was missing the initialization of the 
`wait_count` field in `struct pthread_cond_s`, causing a 
`-Wmissing-field-initializers` warning when statically initializing condition 
variables.
   
   ### Before
   ```c
   struct pthread_cond_s
   {
     sem_t sem;
     clockid_t clockid;
     int wait_count;       // ← not initialized
   };
   
   #define PTHREAD_COND_INITIALIZER {SEM_INITIALIZER(0), CLOCK_REALTIME }
   ```
   
   ### After
   ```c
   #define PTHREAD_COND_INITIALIZER {SEM_INITIALIZER(0), CLOCK_REALTIME, 0 }
   ```
   
   Fixes #19108
   
   ## Impact
   
   Eliminates `-Wmissing-field-initializers` warning for 
`PTHREAD_COND_INITIALIZER`. No functional change since C guarantees 
zero-initialization for missing fields in partial initializers, but the 
explicit initialization is cleaner and silences the warning.
   
   ## Testing
   
   Verified with `grep` that all fields of `struct pthread_cond_s` are now 
covered by the initializer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to