Skip to content

Silence Clang's deprecated-literal-operator warning in gmpxx.h#110

Merged
ahmed-irfan merged 1 commit into
masterfrom
fix/clang-gmpxx-deprecated-literal-operator
May 26, 2026
Merged

Silence Clang's deprecated-literal-operator warning in gmpxx.h#110
ahmed-irfan merged 1 commit into
masterfrom
fix/clang-gmpxx-deprecated-literal-operator

Conversation

@ahmed-irfan
Copy link
Copy Markdown
Member

GMP's gmpxx.h still uses the pre-C++23 operator"" _mpz spelling (with whitespace), which Clang >= 17 diagnoses under -Wdeprecated-literal-operator. Combined with the project's -Wall -Werror, this fails the polyxx build on any modern Clang.

Wrap the gmpxx.h include with a Clang diagnostic push/pop. Also ignore -Wunknown-warning-option so older Clang (< 17), which does not recognize the new warning name, does not itself error under -Werror.

GMP's gmpxx.h still uses the pre-C++23 `operator"" _mpz` spelling
(with whitespace), which Clang >= 17 diagnoses under
-Wdeprecated-literal-operator. Combined with the project's
-Wall -Werror, this fails the polyxx build on any modern Clang.

Wrap the gmpxx.h include with a Clang diagnostic push/pop. Also
ignore -Wunknown-warning-option so older Clang (< 17), which does
not recognize the new warning name, does not itself error under
-Werror.
Copy link
Copy Markdown
Contributor

@Ovascos Ovascos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe create a new .h file to perform the include with all its wrapper to avoid bloating this file?

@ahmed-irfan ahmed-irfan merged commit c342ff1 into master May 26, 2026
16 checks passed
@ahmed-irfan ahmed-irfan deleted the fix/clang-gmpxx-deprecated-literal-operator branch May 26, 2026 09:09
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.

2 participants