Repository navigation
apps: Print the revents field of struct pollfd without a cast. - #3888
Merged
Merged
Conversation
The events and revents fields of struct pollfd now have the type short, as POSIX gives them. A short value is promoted to int, so %x prints it as is. Remove the casts to unsigned int that were added while the fields were a 32-bit pollevent_t. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]>
cederom
approved these changes
Oct 20, 2026
xiaoxiang781216
approved these changes
Oct 20, 2026
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): |
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): |
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): |
xiaoxiang781216
marked this pull request as ready for review
October 24, 2026 11:15
xiaoxiang781216
marked this pull request as draft
October 24, 2026 11:16
acassis
approved these changes
Oct 24, 2026
acassis
marked this pull request as ready for review
October 24, 2026 12:16
This was referenced Oct 24, 2026
acassis
pushed a commit
that referenced
this pull request
Oct 28, 2026
The events and revents fields of struct pollfd now have the type short, as POSIX gives them. A short value is promoted to int, so %x prints it as is. Remove the casts to unsigned int that were added while the fields were a 32-bit pollevent_t. This change was in #3888, which was reverted by #3909 because it merged before apache/nuttx#20796 changed the type. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apache/nuttx#20796 gives the
eventsandreventsfields ofstruct pollfdthe typeshort, as POSIX does. Ashortvalue is promoted toint, so%xprints it as is. This PR removes the eight casts tounsigned intthat #3878 added while the fields were a 32-bitpollevent_t, inexamples/poll,graphics/twm4nx,netutils/ptpd,netutils/thttpdand the kernel socket test suite.This PR must merge after apache/nuttx#20796: with the 32-bit
pollevent_tof master,%xwithout the cast is a-Wformaterror on 32-bit Arm.Impact
Debug and error messages only. No change in behaviour.
Testing
qemu-armv7a:nshwithEXAMPLES_POLL,NETUTILS_PTPD(withDEBUG_PTP_WARN,NET_TIMESTAMP),NETUTILS_THTTPD(with-DCONFIG_THTTPD_FDWATCH_DEBUGandDEBUG_NET_INFO, so thefwinfo()call is compiled) and the network options they need, built withEXTRAFLAGS=-Werrorand arm-gnu-toolchain 13.2.Rel1:poll_listener.cstops the build withformat '%x' expects argument of type 'unsigned int', but argument 3 has type 'pollevent_t' {aka 'long unsigned int'}, as expected.graphics/twm4nxand the kernel socket test suite are not in this build (the change there is the same).tools/checkpatch.sh -c -u -m -gpasses.depends-on: [apache/nuttx/pull/20796]