Re: [xml] built libxml and libxslt, possible bugs



On Thu 2003-11-13 William M. Brack wrote:
[...] libxslt-1.1.0 $ make
[generated many warnings like this one:]
pattern.c:1237: warning: comparison is always true due to limited
range of data type
[... which probably is no problem.]

  Not a big deal, new gcc optimizer defeated some macro handling, I
see them too on Fedora Core 1.

[...]
bill bbrack workdir $ cd libxml2-2.6.2/
bill bbrack libxml2-2.6.2 $ ./configure
<snip>
bill bbrack libxml2-2.6.2 $ make > make.log 2>make.err
bill bbrack libxml2-2.6.2 $ cat make.err
libxml2-py.c: In function `libxml_xmlErrMemory':
libxml2-py.c:4173: warning: implicit declaration of function
`xmlErrMemory'
bill bbrack libxml2-2.6.2 $
  (as a sidenote, the above warning is fixed in CVS :-)

bill bbrack libxml2-2.6.2 $ cd ../libxslt-1.1.0/
bill bbrack libxslt-1.1.0 $ ./configure \
--with-libxml-src=$HOME/workdir/libxml2-2.6.2
<snip>
bill bbrack libxslt-1.1.0 $ make > make.log 2>make.err
bill bbrack libxslt-1.1.0 $ cat make.err
preproc.c: In function `xsltDocumentComp':
preproc.c:207: warning: unused variable `URL'
bill bbrack libxslt-1.1.0 $
  (another sidenote - the above warning is also fixed in CVS)

So, for the two warnings above (nicely balanced, one in each
library) I will take full responsibility, and can only state in my
defense that they were both fixed soon after the release.  For your
"many warnings like this one", however, I am ready to go to war!

I am not, that wouldn't make sense. There must be a misunderstanding,
I simply offer to provide feedback.
But if you want me to show what I referred to with that line:

tobi ~/del/compile_libxml/libxslt-1.1.0 $ make
[...]
pattern.c:1068: warning: comparison is always true due to limited range of data type
pattern.c: In function `xsltScanName':
pattern.c:1129: warning: comparison is always true due to limited range of data type
pattern.c: In function `xsltScanNCName':
pattern.c:1164: warning: comparison is always true due to limited range of data type
pattern.c: In function `xsltCompileIdKeyPattern':
pattern.c:1237: warning: comparison is always true due to limited range of data type
pattern.c:1241: warning: comparison is always true due to limited range of data type
pattern.c:1252: warning: comparison is always true due to limited range of data type
pattern.c:1256: warning: comparison is always true due to limited range of data type
pattern.c:1264: warning: comparison is always true due to limited range of data type
pattern.c:1268: warning: comparison is always true due to limited range of data type
pattern.c:1280: warning: comparison is always true due to limited range of data type
pattern.c:1285: warning: comparison is always true due to limited range of data type
pattern.c:1297: warning: comparison is always true due to limited range of data type
pattern.c:1308: warning: comparison is always true due to limited range of data type
pattern.c:1319: warning: comparison is always true due to limited range of data type
pattern.c: In function `xsltCompileStepPattern':
pattern.c:1372: warning: comparison is always true due to limited range of data type
pattern.c:1426: warning: comparison is always true due to limited range of data type
pattern.c:1533: warning: comparison is always true due to limited range of data type
pattern.c:1572: warning: comparison is always true due to limited range of data type
pattern.c: In function `xsltCompileRelativePathPattern':
pattern.c:1599: warning: comparison is always true due to limited range of data type
pattern.c:1605: warning: comparison is always true due to limited range of data type
pattern.c:1610: warning: comparison is always true due to limited range of data type
pattern.c:1619: warning: comparison is always true due to limited range of data type
pattern.c: In function `xsltCompileLocationPathPattern':
pattern.c:1638: warning: comparison is always true due to limited range of data type
pattern.c:1652: warning: comparison is always true due to limited range of data type
pattern.c:1671: warning: comparison is always true due to limited range of data type
pattern.c:1678: warning: comparison is always true due to limited range of data type
pattern.c:1683: warning: comparison is always true due to limited range of data type
pattern.c: In function `xsltCompilePattern':
pattern.c:1732: warning: comparison is always true due to limited range of data type
[...]
keys.c: In function `xsltAddKey':
keys.c:259: warning: comparison is always true due to limited range of data type
[...]
preproc.c: In function `xsltDocumentComp':
preproc.c:207: warning: unused variable `URL'
[...]
transform.c: In function `xsltDocumentElem':
transform.c:2061: warning: comparison is always true due to limited range of data type
transform.c:2066: warning: comparison is always true due to limited range of data type
[...]

Now, (a little) more seriously:  The line you point out (pattern.c
line 1237) contains the macro SKIP_BLANKS.  That macro is defined
within the source file, but it in turn uses the macro IS_BLANK. 
IS_BLANK is defined within libxml2 (libxml/parserInternals.h), and
was enhanced (by me) prior to release 2.6.x to assure this warning
wouldn't occur.  For you, the warning DID occur, and that implies
when you compiled the libxslt library you were not getting the
correct include file (and it may also imply you weren't getting the
"right" libxml2 libraries as well).

Now that I have zlib-devel installed I'll try again, some things
probably are resolved then.

The most likely way for this to happen (or perhaps I should say "my
best guess") would be during the configuration phase of libxslt. 
Notice in my example above, it is necessary to use the
--with-libxml-src={directory path} if (as you are doing) you want to
use a version of libxml2 which is different than the one installed
on your system.  Also, although it is not clearly set down anywhere
(I learned it through bitter experience), the directory path must be
*absolute*, _not_ relative!

I think what I did these things. In case it helps here's what I did:

tobi ~ $ cd del
tobi ~/del $ mkdir compile_libxml
tobi ~/del $ mkdir ~/bulk/run/libxml
tobi ~/del $ cd compile_libxml
tobi ~/del/compile_libxml $ wget ftp://xmlsoft.org/libxml2-2.6.2.tar.gz
tobi ~/del/compile_libxml $ wget -q ftp://xmlsoft.org/libxslt-1.1.0.tar.gz
tobi ~/del/compile_libxml $ tar xzf libxml2-2.6.2.tar.gz
tobi ~/del/compile_libxml $ tar xzf libxslt-1.1.0.tar.gz
tobi ~/del/compile_libxml $ cd libxml2-2.6.2/
tobi ~/del/compile_libxml/libxml2-2.6.2 $ ./configure --prefix=$HOME/bulk/run/libxml
tobi ~/del/compile_libxml/libxml2-2.6.2 $ make
tobi ~/del/compile_libxml/libxml2-2.6.2 $ make tests
tobi ~/del/compile_libxml/libxml2-2.6.2 $ make install
[...]
tobi ~/bulk/run/libxml $ cat > ~/data/commands/xmllint
tobi ~/bulk/run/libxml $ chmod 0700 ~/data/commands/xmllint
tobi ~/bulk/run/libxml $ xmllint --version
[...]
tobi ~/del/compile_libxml $ cd libxslt-1.1.0/
tobi ~/del/compile_libxml/libxslt-1.1.0 $ mkdir /home/tobi/bulk/run/libxslt
tobi ~/del/compile_libxml/libxslt-1.1.0 $ ./configure \
  --prefix=$HOME/bulk/run/libxslt \
  --with-libxml-src=$HOME/del/compile_libxml/libxml2-2.6.2
tobi ~/del/compile_libxml/libxslt-1.1.0 $ make
tobi ~/del/compile_libxml/libxslt-1.1.0 $ make tests
tobi ~/del/compile_libxml/libxslt-1.1.0 $ make install
[...]

So - if my guess is not correct, give me some more information to
help narrow down the problem.

Which information specifically?

On the other hand, if I'm right, then try re-configuring libxslt
(using the --with-libxml-src flag), then "make clean" and "make"
again (or better, do as in my example and separate the make log file
from the errors/warnings with 2>make.err), then post the make.err
file for further analysis.

I think I'll delete everything, then repeat what I did (this time
zlib-devel should be available), plus 2>make.err. Would that help?

Tobi

-- 
Vim as XML Editor
http://www.vim.org/tips/tip.php?tip_id=583



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]