Re: [xml] HP-UX compilation warnings for 2.6.23
- From: Rick Jones <rick jones2 hp com>
- To: xml gnome org
- Subject: Re: [xml] HP-UX compilation warnings for 2.6.23
- Date: Thu, 23 Feb 2006 11:25:43 -0800
"xpath.c", line 11113: warning #2128-D: loop is not reachable from preceding
code
do {
^
looks buggy to me, there is a goto next_node; below the loop, and
next_node is declared inside the loop, not very nice, but I think the compiler
is in error, probably worth pointing to your compiler engineers...
I'll see what I can do.
"xmlmodule.c", line 284: warning #2167-D: argument of type "void **" is
incompatible with parameter of type "shl_t *"
rc = shl_findsym(&handle, name, TYPE_UNDEFINED, symbol);
IIRC it's a problem of portability of the shared libs loading APIs
between platforms. If you can generate an HP-UX specific patch that would be
good !
HP-UX has dlopen since 11.11. From what I can see of the config.log, it looks
like the configure script isn't looking for it - at least not on HP-UX, or
perhaps finding shl_load is overriding it. I'm a little leary of messing with
configure.in - especially since my HP-UX system does not have autoconf on it at
the moment.
However, I can (and really should) add a check to my netperf4 configure script
to check for dlopen - just plain old AC_CHECK_FUNCS and bring that over to my
HP-UX 11.23 system and indeed, it does find dlopen.
So, it would appear that a bit of configure manipulation might suffice, and then
on those HP-UX systems with dlopen it will take the dlopen path rather than the
shl_load path.
As a proof of concept I tried altering libxml2's config.h after configure to set
HAVE_DLOPEN but make rebuild config.h on me, so I had to hardcode it in
config.h.in. A subsequent recompile appears to have been happy:
source='xmlmodule.c' object='xmlmodule.lo' libtool=yes \^M
DEPDIR=.deps depmode=none /bin/sh ./depcomp \^M
/bin/sh ./libtool --mode=compile --tag=CC cc -DHAVE_CONFIG_H -I. -I.
-I. -I./include -I./include -D_REENTRANT
-g -c -o xmlmodule.lo xmlmodule.c^M
cc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./include -D_REENTRANT -g -c
xmlmodule.c -DPIC -o .libs/xmlmodule.o^M
cc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./include -D_REENTRANT -g -c
xmlmodule.c -o xmlmodule.o >/dev/null 2>&1^M
"runtest.c", line 3857: warning #2177-D: function "thread_specific_data" was
declared but never referenced
thread_specific_data(void *private_data)
^
Seems testThread() is not defined in the case of HP-UX, either extend
#if defined(linux) || defined(solaris) around line 3900 or define a specific
test for the OS. Patch welcome !
Any history as to why it was #if defined(linux) || defined (solaris)?
Since the code in that block is including pthread.h, how about changing the #if
to #ifdef HAVE_PTHREAD_H ?
# diff runtest.c.orig runtest.c
3901c3901
< #if defined(linux) || defined(solaris)
---
> #ifdef HAVE_PTHREAD_H
# diff -c runtest.c.orig runtest.c
*** runtest.c.orig Sat Dec 10 02:48:08 2005
--- runtest.c Thu Feb 23 11:12:26 2006
***************
*** 3898,3904 ****
return ((void *) Okay);
}
! #if defined(linux) || defined(solaris)
#include <pthread.h>
--- 3898,3904 ----
return ((void *) Okay);
}
! #ifdef HAVE_PTHREAD_H
#include <pthread.h>
FWIW that seems to compile cleanly on my system.
"tree2.c", line 30: warning #2550-D: variable "dtd" was set but never used
xmlDtdPtr dtd = NULL; /* DTD pointer */
^
Right, but as an example dropping the result of a function returning a
node would be of bad taste, keeping it is better.
Is it good taste to not check the return value at all ?-) Or free the dtd
pointer at the end? Or did freeing the doc at the end take care of free'ing the dtd?
# diff -c ../libxml2-2.6.22/doc/examples/tree2.c doc/examples/tree2.c
*** ../libxml2-2.6.22/doc/examples/tree2.c Sun Jan 2 02:25:03 2005
--- doc/examples/tree2.c Thu Feb 23 11:24:05 2006
***************
*** 45,50 ****
--- 45,56 ----
*/
dtd = xmlCreateIntSubset(doc, BAD_CAST "root", NULL, BAD_CAST "tree2.dtd");
+ /* this is just to suppress any overly enthusiastic compiler warnings
+ about the dtd not being referenced. */
+ if (NULL == dtd) {
+ i = 0;
+ }
+
/*
* xmlNewChild() creates a new node, which is "attached" as child node
* of root_node node.
(I forgot to do the mv foo.c foo.c.orig; cp foo.c.orig foo.c bit so the diff is
against 2.6.22)
Making all in examples
source='tree2.c' object='tree2.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh ../../depcomp \
cc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include -I../../include
-I./include -D_REENTRANT -g -c tree2.c
/bin/sh ../../libtool --mode=link --tag=CC cc -g -o tree2 tree2.o
../../libxml2.la -lpthread -lm
cc -g -o .libs/tree2 tree2.o ../../.libs/libxml2.so -lpthread -lm
creating tree2
rick jones
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]