jsanchez-2g opened a new pull request, #19913:
URL: https://github.com/apache/nuttx/pull/19913

   ## Summary
   
   - Decode the saved USB SETUP request fields whenever `stm32_ep0setup()` 
processes the request.
   - `stm32_ep0setup()` may be entered again after receiving an OUT data phase. 
Previously, the local `value`, `index`, and `len` fields were only initialized 
during the first invocation.
   - This could use uninitialized values when completing an OUT control 
transfer.
   - Clang detects this path and fails builds using 
`-Werror=maybe-uninitialized`.
   - This fix is required by apache/nuttx#19910.
   
   ## Impact
   
   - Is new functionality added? NO.
   - Is existing functionality changed? YES. STM32 M0 USB control requests with 
an OUT data phase consistently decode their saved SETUP request.
   - Impact on user? NO.
   - Impact on build? YES. STM32 M0 USB configurations now build successfully 
with Clang when maybe-uninitialized warnings are treated as errors.
   - Impact on hardware? Limited to the common STM32 M0 USB device driver.
   - Impact on documentation? NO.
   - Impact on security? NO.
   - Impact on compatibility? NO.
   
   ## Testing
   
   I confirm that the changes were verified locally and work as intended.
   
   - Target: STM32L0, `nucleo-l073rz:usb-cdc`
   - GNU Arm Embedded GCC build: PASS
   - Clang build using `ghcr.io/apache/nuttx/apache-nuttx-ci-linux`: PASS
   - `checkpatch.sh`, codespell, and cvt2utf: PASS
   - Hardware programming and boot: PASS
   - NSH operation and USB functionality: PASS
   
   Before this change, the Clang build failed with:
   
   ```text
   error: 'value.w' may be used uninitialized
   error: 'len.w' may be used uninitialized
   cc1: all warnings being treated as errors
   


-- 
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