[XML-SIG] PyXML 0.5.4 installation glitches

Mark Favas m.favas@per.dem.csiro.au
Fri, 05 May 2000 03:11:58 +0800


Platform: DEC Alpha, Tru64 Unix V4.0F, Compaq C V6.1-110, Python 1.6a2
(#91, May  5 2000, 01:57:36) (from CVS)

Running "python setup.py build" produces the following error:
building 'xml.parsers.pyexpat' extension
cc -c -Iextensions/expat/xmltok -Iextensions/expat/xmlparse
-I/usr/local/include/python1.6 -O -Olimit 1500 extensions/pyexpat.c -o
build/temp.osf1V-alpha/extensions/pyexpat.o
cc: Error: extensions/pyexpat.c, line 82: The static declaration of
"handler_info" is a tentative definition and specifies an incomplete
type. (incompstat)
static struct HandlerInfo handler_info[];
--------------------------^
error: command 'cc' failed with exit status 1

Changing the indicated line to
static struct HandlerInfo handler_info[64];
allows the compilation to proceed with the following warnings:
cc: Warning: extensions/pyexpat.c, line 821: In the initializer for
handler_info
[0].handler, the referenced type of the pointer value
"my_StartElementHandler" i
s "function (pointer to void, pointer to const char, pointer to pointer
to const
 char) returning void", which is not compatible with "void".
(ptrmismatch)
        my_StartElementHandler},
--------^
cc: Warning: extensions/pyexpat.c, line 824: In the initializer for
handler_info
[1].handler, the referenced type of the pointer value
"my_EndElementHandler" is
"function (pointer to void, pointer to const char) returning void",
which is not
 compatible with "void". (ptrmismatch)
        my_EndElementHandler},
--------^
cc: Warning: extensions/pyexpat.c, line 827: In the initializer for
handler_info
[2].handler, the referenced type of the pointer value
"my_ProcessingInstructionH
andler" is "function (pointer to void, pointer to const char, pointer to
const c
har) returning void", which is not compatible with "void". (ptrmismatch)
        my_ProcessingInstructionHandler},
--------^
cc: Warning: extensions/pyexpat.c, line 830: In the initializer for
handler_info
[3].handler, the referenced type of the pointer value
"my_CharacterDataHandler"
is "function (pointer to void, pointer to const char, int) returning
void", whic
h is not compatible with "void". (ptrmismatch)
        my_CharacterDataHandler},
--------^
cc: Warning: extensions/pyexpat.c, line 833: In the initializer for
handler_info
[4].handler, the referenced type of the pointer value
"my_UnparsedEntityDeclHand
ler" is "function (pointer to void, pointer to const char, pointer to
const char
, pointer to const char, pointer to const char, pointer to const char)
returning
 void", which is not compatible with "void". (ptrmismatch)
        my_UnparsedEntityDeclHandler },
--------^
cc: Warning: extensions/pyexpat.c, line 836: In the initializer for
handler_info
[5].handler, the referenced type of the pointer value
"my_NotationDeclHandler" i
s "function (pointer to void, pointer to const char, pointer to const
char, poin
ter to const char, pointer to const char) returning void", which is not
compatib
le with "void". (ptrmismatch)
        my_NotationDeclHandler },
--------^
cc: Warning: extensions/pyexpat.c, line 839: In the initializer for
handler_info
[6].handler, the referenced type of the pointer value
"my_StartNamespaceDeclHand
ler" is "function (pointer to void, pointer to const char, pointer to
const char
) returning void", which is not compatible with "void". (ptrmismatch)
        my_StartNamespaceDeclHandler },
--------^
cc: Warning: extensions/pyexpat.c, line 842: In the initializer for
handler_info
[7].handler, the referenced type of the pointer value
"my_EndNamespaceDeclHandle
r" is "function (pointer to void, pointer to const char) returning
void", which
is not compatible with "void". (ptrmismatch)
        my_EndNamespaceDeclHandler },
--------^
cc: Warning: extensions/pyexpat.c, line 845: In the initializer for
handler_info
[8].handler, the referenced type of the pointer value
"my_CommentHandler" is "fu
nction (pointer to void, pointer to const char) returning void", which
is not co
mpatible with "void". (ptrmismatch)
        my_CommentHandler},
--------^
cc: Warning: extensions/pyexpat.c, line 848: In the initializer for
handler_info
[9].handler, the referenced type of the pointer value
"my_StartCdataSectionHandl
er" is "function (pointer to void) returning void", which is not
compatible with
 "void". (ptrmismatch)
        my_StartCdataSectionHandler},
--------^
cc: Warning: extensions/pyexpat.c, line 851: In the initializer for
handler_info
[10].handler, the referenced type of the pointer value
"my_EndCdataSectionHandle
r" is "function (pointer to void) returning void", which is not
compatible with
"void". (ptrmismatch)
        my_EndCdataSectionHandler},
--------^
cc: Warning: extensions/pyexpat.c, line 854: In the initializer for
handler_info
[11].handler, the referenced type of the pointer value
"my_DefaultHandler" is "f
unction (pointer to void, pointer to const char, int) returning void",
which is
not compatible with "void". (ptrmismatch)
        my_DefaultHandler},
--------^
cc: Warning: extensions/pyexpat.c, line 857: In the initializer for
handler_info
[12].handler, the referenced type of the pointer value
"my_DefaultHandlerExpandH
andler" is "function (pointer to void, pointer to const char, int)
returning voi
d", which is not compatible with "void". (ptrmismatch)
        my_DefaultHandlerExpandHandler},
--------^
cc: Warning: extensions/pyexpat.c, line 860: In the initializer for
handler_info
[13].handler, the referenced type of the pointer value
"my_NotStandaloneHandler"
 is "function (pointer to void) returning int", which is not compatible
with "vo
id". (ptrmismatch)
        my_NotStandaloneHandler},
--------^
cc: Warning: extensions/pyexpat.c, line 863: In the initializer for
handler_info
[14].handler, the referenced type of the pointer value
"my_ExternalEntityRefHand
ler" is "function (pointer to void, pointer to const char, pointer to
const char
, pointer to const char, pointer to const char) returning int", which is
not com
patible with "void". (ptrmismatch)
        my_ExternalEntityRefHandler },
--------^


The link step also appears to have a wildcard quoting problem. The ld
command used is:
ld -shared -expect_unresolved "*"
build/temp.osf1V-alpha/extensions/pyexpat.o 
build/temp.osf1V-alpha/extensions/expat/xmltok/xmltok.o
build/temp.osf1V-alpha/extensions/expat/xmltok/xmlrole.o
build/temp.osf1V-alpha/extensions/expat/xmlwf/xmlfile.o
build/temp.osf1V-alpha/extensions/expat/xmlwf/xmlwf.o
build/temp.osf1V-alpha/extensions/expat/xmlwf/codepage.o
build/temp.osf1V-alpha/extensions/expat/xmlparse/xmlparse.o
build/temp.osf1V-alpha/extensions/expat/xmlparse/hashtable.o 
build/temp.osf1V-alpha/extensions/expat/xmlwf/unixfilemap.o -o
build/lib.osf1V-alpha/xml/parsers/pyexpat.so

which works correctly if put into a /bin/sh script produces pyexpat.so
without warnings of unresolved externals (the -expect_unresolved "*"
pattern matches all). However, when run by Python via the "python
setup.py build" command, ld complains about all the unresolved
externals:
ld:
Warning: Unresolved:
fread
strlen
strncpy
strcmp
free
malloc
PyType_Type
PyObject_GetAttrString
_Py_NoneStruct
PyObject_Init
<snipped>
as if the pattern that ld is trying to match is literally "*" instead of
*


-- 
Email  - m.favas@per.dem.csiro.au        Mark C Favas
Phone  - +61 8 9333 6268, 0418 926 074   CSIRO Exploration & Mining
Fax    - +61 8 9383 9891                 Private Bag Post Office Wembley
GPS    - 31.97 S, 115.81 E               Western Australia 6014