fix: unbreak macOS CI on AppleClang int→double limits#251
Merged
Conversation
Explicitly cast JINTEGER_MAX/MIN and UINTMAX_MAX to JNUMBER in the saturation comparisons in n_cjson.c and n_ftoa.c. INT64_MAX and UINTMAX_MAX are not exactly representable as double; newer AppleClang (Xcode 26.5 on macos-latest) rejects the implicit conversion when the note_c test library is built with -Werror. Keeps run_macos_unit_tests on macos-latest with a short comment explaining the source-side fix.
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
macos-latestnow resolves to macOS 26 / Xcode 26.5. Therun_macos_unit_testsjob builds the sharednote_ctest library with-Werror, and AppleClang started failing on long-standing saturation comparisons that implicitly convertINT64_MAX/UINTMAX_MAXtoJNUMBER(double).macos-15-arm64(2026-07-03); the first red one onmacos-26-arm64(2026-07-15).JNUMBERat the comparison sites inn_cjson.candn_ftoa.cso the conversion is explicit. Behavior remains the same approximate float-range saturation already documented inn_ftoa.c.run_macos_unit_testsonmacos-latestand document why the build stays green.Companion: PR #250 temporarily pins that job to
macos-15so the time-sync change is not blocked by this toolchain shift.Test plan
cmake -B build -DNOTE_C_BUILD_TESTS=ON && cmake --build build --target note_csucceeds on AppleClang without-Wno-implicit-const-int-float-conversionrun_macos_unit_testsgreen onmacos-latest(macOS 26)