Skip to content

fix: unbreak macOS CI on AppleClang int→double limits#251

Merged
zfields merged 1 commit into
masterfrom
fix/macos-appleclang-int-float
Jul 16, 2026
Merged

fix: unbreak macOS CI on AppleClang int→double limits#251
zfields merged 1 commit into
masterfrom
fix/macos-appleclang-int-float

Conversation

@zfields

@zfields zfields commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • macos-latest now resolves to macOS 26 / Xcode 26.5. The run_macos_unit_tests job builds the shared note_c test library with -Werror, and AppleClang started failing on long-standing saturation comparisons that implicitly convert INT64_MAX / UINTMAX_MAX to JNUMBER (double).
  • This is independent of application changes (e.g. time-sync defaults). The last green macOS job ran on macos-15-arm64 (2026-07-03); the first red one on macos-26-arm64 (2026-07-15).
  • Fix: cast the integer limits to JNUMBER at the comparison sites in n_cjson.c and n_ftoa.c so the conversion is explicit. Behavior remains the same approximate float-range saturation already documented in n_ftoa.c.
  • CI: leave run_macos_unit_tests on macos-latest and document why the build stays green.

Companion: PR #250 temporarily pins that job to macos-15 so the time-sync change is not blocked by this toolchain shift.

Test plan

  • Local host: cmake -B build -DNOTE_C_BUILD_TESTS=ON && cmake --build build --target note_c succeeds on AppleClang without -Wno-implicit-const-int-float-conversion
  • CI: run_macos_unit_tests green on macos-latest (macOS 26)
  • CI: Linux unit-test jobs still green

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.
@zfields
zfields merged commit 33c4eeb into master Jul 16, 2026
16 checks passed
@zfields
zfields deleted the fix/macos-appleclang-int-float branch July 16, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant