Skip to content

fix: suppress deprecated-literal-operator error on Apple Clang 21+ - #57

Open
SebTardif wants to merge 1 commit into
cvc5:mainfrom
SebTardif:fix/poly-ep-deprecated-literal-operator
Open

fix: suppress deprecated-literal-operator error on Apple Clang 21+#57
SebTardif wants to merge 1 commit into
cvc5:mainfrom
SebTardif:fix/poly-ep-deprecated-literal-operator

Conversation

@SebTardif

Copy link
Copy Markdown

Fixes #56

Problem

On macOS 26+ with Apple Clang 21, the static build fails during the
Poly-EP ExternalProject because gmpxx.h uses a deprecated
whitespace-before-suffix syntax in user-defined literal operators
(operator"" _mpz, _mpq, _mpf). libpoly's own CMakeLists.txt
compiles with -Werror, promoting the warning to a fatal error.

cvc5's cmake/FindPoly.cmake already has a workaround that passes
-DCMAKE_CXX_FLAGS=-Wno-error=deprecated-literal-operator to the
Poly-EP ExternalProject, but only for WASM builds. Native macOS
builds get no suppression.

Fix

Make the warning suppression unconditional by patching FindPoly.cmake
before running configure.sh. The patch replaces the WASM-only
conditional with an unconditional assignment, and uses the strong form
(-Wno-deprecated-literal-operator) instead of the weak form
(-Wno-error=deprecated-literal-operator). The strong form suppresses
the warning entirely, so it works regardless of where -Werror appears
on the command line.

The patch is applied in two places:

  • cvc5-sys/build.rs: for users building from source via cargo build --features static
  • .github/actions/setup-cvc5/action.yml: for CI builds on macOS runners

The patch is idempotent: if FindPoly.cmake doesn't contain the
expected text (e.g., upstream has already fixed this), it silently
does nothing.

Environment

  • macOS 26.5.1 (Tahoe), Apple M4 Max
  • Apple Clang 21.0.0 (clang-2100.0.36.7)
  • GMP 6.3.0, CMake 4.3.4
  • cvc5-sys 0.4.0, cvc5 submodule at v1.3.1 (ea1b484)

Related

On macOS 26+ with Apple Clang 21, the static build fails during the
Poly-EP ExternalProject because gmpxx.h uses a deprecated
whitespace-before-suffix syntax in user-defined literal operators.
libpoly compiles with -Werror, promoting the warning to a fatal error.

cvc5's cmake/FindPoly.cmake already suppresses this warning for WASM
builds but not for native macOS. This patch makes the suppression
unconditional by patching FindPoly.cmake before running configure.sh,
using the strong form (-Wno-deprecated-literal-operator) that works
regardless of -Werror ordering.

The patch is applied in both build.rs (for cargo build --features static)
and the setup-cvc5 CI action (for GitHub Actions macOS runners). It is
idempotent: if FindPoly.cmake does not contain the expected text, the
patch silently does nothing.

Closes cvc5#56
SebTardif added a commit to assura-lang/assura that referenced this pull request Jul 27, 2026
## Summary

MPI pre-rotation gate: land accepted documentation backlog.

- **#1413** Competitor-thread reply playbook
(`docs/launch/competitor-replies.md`)
- **#1411** RFMIG outreach outline (`docs/launch/rfmig-intro.md`)
- **#1412** SMT / portfolio technical note (`docs/SMT-NOTE.md`, mdBook
link)
- **#1399** Document deferred playground alternative: Codespaces
(`.devcontainer/`) + demo GIF + install path in GETTING-STARTED

## Not in this PR

- **#1410** Actual public posts (Show HN / Lobsters / Reddit / TWiR)
need a human owner
- **#1396** Awesome-list submissions after hard launch (#1410)
- **#436** Still blocked on cvc5/cvc5-rs#57

## Test plan

- [x] Docs are markdown only + symlink; no Rust changes
- [ ] Spot-check links in `docs/launch/README.md` and `docs/SMT-NOTE.md`
- [ ] Confirm mdBook SUMMARY includes SMT note

Closes #1413
Closes #1411
Closes #1412
Closes #1399

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
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.

cvc5-sys 0.4.0: Poly-EP build fails on macOS with Apple Clang 21+ (deprecated-literal-operator in gmpxx.h)

1 participant