[XML-SIG] PyXML 0.5.5.1 pyexpat compilation errors

Mark Favas m.favas@per.dem.csiro.au
Wed, 14 Jun 2000 05:38:41 +0800


I mailed a message to this group about similar issues with 0.5.4 last
month, but I guess it got buried... ;)

The issues are (details below):
1)  pyexpat.c fails to compile without changes, and still has warnings
when changed so that compilation does succeed
2)  the linking step has a wildcard ("*") quoting problem
3)  build_ext complains about old-style usage
4)  parsers/xmlproc is an older version than that available from Lars's
website

Platform: DEC Alpha, Tru64 Unix V4.0F, Compaq C V6.1-110, Python 1.6a2
(#111, Jun 13 2000, 03:39:26) [C] on osf1V4 from CVS 13th June

"python setup.py build" produces the following errors:

running build_ext
warning: build_ext: old-style (ext_name, build_info) tuple found in
ext_modules for extension 'xml.parsers.pyexpat'-- please convert to
Extension instance

building 'xml.parsers.pyexpat' extension
creating build/temp.osf1V-alpha
creating build/temp.osf1V-alpha/extensions
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)
staticforward struct HandlerInfo handler_info[];
---------------------------------^
error: command 'cc' failed with exit status 1


Specifying an actual size for handler_info[] by replacing line 82 with
staticforward struct HandlerInfo handler_info[64];
allows the compilation to proceed, with the following warnings:

cc: Warning: extensions/pyexpat.c, line 834: 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 837: 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 840: 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 843: 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 846: 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 849: 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 852: 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 855: 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 858: 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 861: 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 864: 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 867: 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 870: 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 873: 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 876: 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 "*"
(double-quote-*-double-quote) 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 No 5, Wembley
WGS84  - 31.95 S, 115.80 E               Western Australia 6913