Skip to content

Commit ed3936e

Browse files
authored
xalanc: fix Clang 19 and GCC 15 compat (#407880)
2 parents b7407d8 + 3714001 commit ed3936e

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
diff --git a/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp b/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp
2+
index 8741cea49..075b1ad4f 100644
3+
--- a/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp
4+
+++ b/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp
5+
@@ -301,43 +301,6 @@ public:
6+
return write(chars, start, length, m_charRefFunctor);
7+
}
8+
9+
- void
10+
- writeSafe(
11+
- const XalanDOMChar* theChars,
12+
- size_type theLength)
13+
- {
14+
- for(size_type i = 0; i < theLength; ++i)
15+
- {
16+
- const XalanDOMChar ch = theChars[i];
17+
-
18+
- if (isUTF16HighSurrogate(ch) == true)
19+
- {
20+
- if (i + 1 >= theLength)
21+
- {
22+
- throwInvalidUTF16SurrogateException(ch, 0, getMemoryManager());
23+
- }
24+
- else
25+
- {
26+
- XalanUnicodeChar value = decodeUTF16SurrogatePair(ch, theChars[i+1], getMemoryManager());
27+
-
28+
- if (this->m_isPresentable(value))
29+
- {
30+
- write(value);
31+
- }
32+
- else
33+
- {
34+
- this->writeNumberedEntityReference(value);
35+
- }
36+
-
37+
- ++i;
38+
- }
39+
- }
40+
- else
41+
- {
42+
- write(static_cast<XalanUnicodeChar>(ch));
43+
- }
44+
- }
45+
- }
46+
47+
void
48+
write(const XalanDOMChar* theChars)

pkgs/by-name/xa/xalanc/package.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ stdenv.mkDerivation {
1818
sha256 = "sha256:0q1204qk97i9h14vxxq7phcfpyiin0i1zzk74ixvg4wqy87b62s8";
1919
};
2020

21+
patches = [
22+
# See https://github.com/llvm/llvm-project/issues/96859
23+
# xalan-c contains a templated code path that tries to access non-existent methods,
24+
# but before Clang 19 and GCC 15 this was no error as the template was never instantiated.
25+
# Note that the suggested fix of adding "-fdelayed-template-parsing"
26+
# to CXX_FLAGS would be sufficient for Clang 19, but as it would break again
27+
# once we upgrade to GCC 15, we remove the dead code entirely.
28+
./0001-clang19-gcc15-compat.patch
29+
];
30+
2131
nativeBuildInputs = [ cmake ];
2232
buildInputs = [
2333
xercesc

0 commit comments

Comments
 (0)