xalanc: fix Clang 19 and GCC 15 compat (#407880)

This commit is contained in:
Niklas Korz
2025-05-17 16:49:49 +02:00
committed by GitHub
2 changed files with 58 additions and 0 deletions
@@ -0,0 +1,48 @@
diff --git a/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp b/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp
index 8741cea49..075b1ad4f 100644
--- a/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp
+++ b/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp
@@ -301,43 +301,6 @@ public:
return write(chars, start, length, m_charRefFunctor);
}
- void
- writeSafe(
- const XalanDOMChar* theChars,
- size_type theLength)
- {
- for(size_type i = 0; i < theLength; ++i)
- {
- const XalanDOMChar ch = theChars[i];
-
- if (isUTF16HighSurrogate(ch) == true)
- {
- if (i + 1 >= theLength)
- {
- throwInvalidUTF16SurrogateException(ch, 0, getMemoryManager());
- }
- else
- {
- XalanUnicodeChar value = decodeUTF16SurrogatePair(ch, theChars[i+1], getMemoryManager());
-
- if (this->m_isPresentable(value))
- {
- write(value);
- }
- else
- {
- this->writeNumberedEntityReference(value);
- }
-
- ++i;
- }
- }
- else
- {
- write(static_cast<XalanUnicodeChar>(ch));
- }
- }
- }
void
write(const XalanDOMChar* theChars)
+10
View File
@@ -18,6 +18,16 @@ stdenv.mkDerivation {
sha256 = "sha256:0q1204qk97i9h14vxxq7phcfpyiin0i1zzk74ixvg4wqy87b62s8";
};
patches = [
# See https://github.com/llvm/llvm-project/issues/96859
# xalan-c contains a templated code path that tries to access non-existent methods,
# but before Clang 19 and GCC 15 this was no error as the template was never instantiated.
# Note that the suggested fix of adding "-fdelayed-template-parsing"
# to CXX_FLAGS would be sufficient for Clang 19, but as it would break again
# once we upgrade to GCC 15, we remove the dead code entirely.
./0001-clang19-gcc15-compat.patch
];
nativeBuildInputs = [ cmake ];
buildInputs = [
xercesc