From fe99cac64957b364c75f09d9a92ccb4db4373604 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sun, 10 Dec 2023 21:56:48 +0100 Subject: external/graphite: operation between different enumeration types > workdir/UnpackedTarball/graphite/src/Pass.cpp:197:92: error: invalid arithmetic between different enumeration types ('status_t' and 'graphite2::errors') > 197 | || e.test(m_cPConstraint.status() != Code::loaded, m_cPConstraint.status() + E_CODEFAILURE)) > | ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~ etc. as reported now with --with-latest-c++ (i.e., in C++26 mode) by Clang 18 trunk since "[Clang] Implement P2864R2 Remove Deprecated Arithmetic Conversion on Enumerations (#73105)" Change-Id: I34b2743d46b8f46b1f39b2af812f95876e4b9e38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160550 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- external/graphite/UnpackedTarball_graphite.mk | 1 + external/graphite/enumarith.patch | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 external/graphite/enumarith.patch diff --git a/external/graphite/UnpackedTarball_graphite.mk b/external/graphite/UnpackedTarball_graphite.mk index 464fcc256069..0f678542e80f 100644 --- a/external/graphite/UnpackedTarball_graphite.mk +++ b/external/graphite/UnpackedTarball_graphite.mk @@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,graphite,0)) $(eval $(call gb_UnpackedTarball_add_patches,graphite, \ external/graphite/ubsan.patch \ + external/graphite/enumarith.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/graphite/enumarith.patch b/external/graphite/enumarith.patch new file mode 100644 index 000000000000..f5b83097f2b6 --- /dev/null +++ b/external/graphite/enumarith.patch @@ -0,0 +1,22 @@ +--- src/Pass.cpp ++++ src/Pass.cpp +@@ -194,7 +194,7 @@ + m_cPConstraint = vm::Machine::Code(true, pcCode, pcCode + pass_constraint_len, + precontext[0], be::peek(sort_keys), *m_silf, face, PASS_TYPE_UNKNOWN); + if (e.test(!m_cPConstraint, E_OUTOFMEM) +- || e.test(m_cPConstraint.status() != Code::loaded, m_cPConstraint.status() + E_CODEFAILURE)) ++ || e.test(m_cPConstraint.status() != Code::loaded, +m_cPConstraint.status() + E_CODEFAILURE)) + return face.error(e); + face.error_context(face.error_context() - 1); + } +@@ -266,8 +266,8 @@ + r->constraint = new (m_codes+n*2-1) vm::Machine::Code(true, rc_begin, rc_end, r->preContext, r->sort, *m_silf, face, pt, &prog_pool_free); + + if (e.test(!r->action || !r->constraint, E_OUTOFMEM) +- || e.test(r->action->status() != Code::loaded, r->action->status() + E_CODEFAILURE) +- || e.test(r->constraint->status() != Code::loaded, r->constraint->status() + E_CODEFAILURE) ++ || e.test(r->action->status() != Code::loaded, +r->action->status() + E_CODEFAILURE) ++ || e.test(r->constraint->status() != Code::loaded, +r->constraint->status() + E_CODEFAILURE) + || e.test(!r->constraint->immutable(), E_MUTABLECCODE)) + return face.error(e); + } -- cgit