fix(core-net): cast uint32_t grace_us for %u format specifier#3618
Open
vikramdattu wants to merge 2 commits into
Open
fix(core-net): cast uint32_t grace_us for %u format specifier#3618vikramdattu wants to merge 2 commits into
vikramdattu wants to merge 2 commits into
Conversation
connect3.c logs grace_us (uint32_t) with %u. On toolchains where uint32_t is 'long unsigned int' (e.g. xtensa-esp-elf for ESP-IDF v5.3/v5.4) this trips -Werror=format and fails the build. Cast to unsigned int to match the specifier; the value (grace timer in us) always fits.
|
4e74eb8 to
0013069
Compare
vikramdattu
added a commit
to vikramdattu/esp-protocols
that referenced
this pull request
Jun 20, 2026
warmcat/libwebsockets#3618 (cast uint32_t grace_us for the %u format specifier in connect3.c) is now on main, so move the pin forward from the temporary parent-commit pin to current main (00130694a). Verified: examples/client builds clean on ESP-IDF v6.0 (esp32).
6eecf5a to
b4b5aed
Compare
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.



Problem
lib/core-net/client/connect3.clogsgrace_us(auint32_t) with a%uspecifier:On toolchains where
uint32_tis typedef'd aslong unsigned int(e.g.xtensa-esp-elffor ESP-IDF v5.3 / v5.4),%u(which expectsunsigned int) mismatches the argument type and trips-Werror=format, failing the build:(Found while building libwebsockets as a component on ESP-IDF. Toolchains where
uint32_tisunsigned intdon't warn, so it only shows on some targets.)Fix
Cast to
unsigned intto match the%uspecifier — matching the existing logging idiom in core-net (rather than pulling inPRIu32). The value is a grace timer in microseconds and always fits.