Ray's Knowledge Base
Unlock

The macOS wheel targets 11.3, so floating-point to_chars and from_chars must go through the project helpers

PitfallVerified 5 Oct 2026Holds project: dftracer-utils
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

Calls to floating-point std::to_chars or std::from_chars compile on a dev Mac but fail in the macOS wheel build.

Cause#

The wheel targets a low deployment version (11.3), and Apple's libc++ gates the floating-point overloads to much newer macOS releases.

Fix#

Use the helpers in core/common/to_chars.h: to_chars_double, double_text, from_chars_double (with a strtod fallback). To find every offender before CI, run -mmacosx-version-min=<target> -fsyntax-only over all library sources. Do not grep only a few files: header inlines such as duql/builder.h hide more callers.

Evidence#

Observed note from dftracer-utils wheel build work.

Also found by searching

  • std::to_chars double is unavailable: introduced in macOS 13.3
  • macOS wheel build fails on std::from_chars double but it compiles on my Mac
  • how do I find every floating-point to_chars call before CI for a low macOS deployment target
  • to_chars_double double_text from_chars_double helpers