Conversation
fhgffy
marked this pull request as ready for review
October 4, 2026 08:52
This branch has not been deployed
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
Preserve the 32-bit bit pattern when writing negative
CONFIG_TYPE_INTvalues in binary format.On the current base,
v = 0b10000000000000000000000000000000;reads as a 32-bit integer with value -2147483648. Writing it passes that negative value to anint64_tformatter, which sign-extends it and emits 64 binary digits. Reading the generated configuration then fails with a syntax error.Convert through
uint32_tbefore calling the formatter. This keeps the 32-bit representation while leaving the parser, INT64 writer, and other formats unchanged.The regression checks exact output, EOF, parsed type/value/format, and both per-setting and configuration-default binary formatting for INT32_MIN, INT32_MIN+1, -2, -1, 0, 1, and INT32_MAX.
Validation
Tested on Linux x86_64 with GCC/G++ 14.2.0 and CMake 3.31.6, based on
1e2dedd046f5119e67b0ccbda5916e8aff55c142:ASAN_OPTIONS=detect_leaks=0; leak checking was not performedgit diff --checkpassesWindows, macOS, 32-bit hosts, embedded targets, fuzzing, and Autotools builds were not tested locally.
autoreconfwas unavailable.Scope
This fix is separate from #302 (integer-to-double setters) and pending #303 (explicit L/LL suffix parsing). Neither patch is included here.
Existing negative INT64 binary output remains unreadable on this base, and explicit-L positive values between INT32_MAX+1 and UINT32_MAX still parse incorrectly without #303. Those behaviors are unchanged by this patch; this does not fix every binary integer round trip.