I've been looking at upgrading a bunch of our bundled dependencies, and
it looks like upgrading libxslt (or maybe libxml2) breaks the build on
The writerfilter module uses xsltproc to generate the header
resources.hxx, and in some cases it contains invalid C cod such as:
whereas it should be:
The shift fragment of this expression comes from this xsl template:
If there is a nonzero shift, the it should output "foo>>shift;", and if
the shift amount is zero, then it should just output "foo;".
In the normal case, the input data looks like:
for a shift amount of zero. One example of the broken case it is:
so the value is missing (the tag is self-closing in this case),
so presumably the if condition in the template is 'if test=">0"'. So
this input is looking pretty questionable.
The mystery is why this behaves differently on CentOS 5 vs. everywhere
else. Only the resources.hxx header generated by CentOS 5 is broken.
One thing I noticed is that my CentOS 5 machine has system libxml and
libxslt libraries installed and they have the same library version
numbers as the ones we build. My CentOS 6 machine does not. The system
xsltproc generates a valid resources.hxx header. One thought I had was
that the xsltproc that we build might be picking up the system
librariese and there was some subtle incompatiblity, but that does not
appear to be the case. My other thought was some sort of compiler bug
triggered by the new code, but building the libxml2 and libxslt modules
with -O0 optimization did not change anything.
Probably the best fix is to modify the template to check for blank shift
values, but the mystery remains.