[XML-SIG] FW: pyexpat compilation errors - Python 2.0b1

Paul Prescod paul@prescod.net
Tue, 04 Jul 2000 09:54:45 -0500


"Favas, Mark (EM, Floreat)" wrote:
> 
> ...
>
> $ cc ./pyexpat.c
> cc: Error: ./pyexpat.c, line 69: 
> The static declaration of "handler_info" is a tentative definition 
> and specifies an incomplete type. (incompstat)
>
> staticforward struct HandlerInfo handler_info[];
> ---------------------------------^

I don't know why cc needs to know the size of the array at that point!
 
> If I replace this definition by
> staticforward struct HandlerInfo handler_info[64];
> pyexpat then compiles (with the following warnings):
> 
> (64 was just chosen at random - needs to be larger than 1, though...)

That's a hack but I can't think of anything it would break. I'd hate to
trade a compile error for a mysterious crash, though. I'll check with
Python-dev and xml-sig.

For the record, here's the structure we are predeclaring. 

statichere struct HandlerInfo handler_info[]=
{{"StartElementHandler", 
	pyxml_SetStartElementHandler, 
	(void*)my_StartElementHandler},
{"EndElementHandler", 
	pyxml_SetEndElementHandler, 
	(void*)my_EndElementHandler},
{"ProcessingInstructionHandler", 
	(xmlhandlersetter)XML_SetProcessingInstructionHandler,
	(void*)my_ProcessingInstructionHandler},
{"CharacterDataHandler", 
	(xmlhandlersetter)XML_SetCharacterDataHandler,
	(void*)my_CharacterDataHandler},
{"UnparsedEntityDeclHandler", 
	(xmlhandlersetter)XML_SetUnparsedEntityDeclHandler,
	(void*)my_UnparsedEntityDeclHandler },
{"NotationDeclHandler", 
	(xmlhandlersetter)XML_SetNotationDeclHandler,
	(void*)my_NotationDeclHandler },
{"StartNamespaceDeclHandler", 
	pyxml_SetStartNamespaceDeclHandler,
	(void*)my_StartNamespaceDeclHandler },
{"EndNamespaceDeclHandler", 
	pyxml_SetEndNamespaceDeclHandler,
	(void*)my_EndNamespaceDeclHandler },
{"CommentHandler",
	(xmlhandlersetter)XML_SetCommentHandler,
	(void*)my_CommentHandler},
{"StartCdataSectionHandler",
	pyxml_SetStartCdataSection,
	(void*)my_StartCdataSectionHandler},
{"EndCdataSectionHandler",
	pyxml_SetEndCdataSection,
	(void*)my_EndCdataSectionHandler},
{"DefaultHandler",
	(xmlhandlersetter)XML_SetDefaultHandler,
	(void*)my_DefaultHandler},
{"DefaultHandlerExpand",
	(xmlhandlersetter)XML_SetDefaultHandlerExpand,
	(void*)my_DefaultHandlerExpandHandler},
{"NotStandaloneHandler",
	(xmlhandlersetter)XML_SetNotStandaloneHandler,
	(void*)my_NotStandaloneHandler},
{"ExternalEntityRefHandler",
	(xmlhandlersetter)XML_SetExternalEntityRefHandler,
	(void*)my_ExternalEntityRefHandler },

{NULL, NULL, NULL } /* sentinel */
};


-- 
 Paul Prescod - Not encumbered by corporate consensus
The great era of mathematical physics is now over; the 300-year effort
to
represent the material world in mathematical terms has exhausted itself.
The
understanding it was to provide is infinitely closer than it was when
Isaac
Newton wrote in the late seventeenth centruy, but it is still infinitely
far
away.
	- The Advent of the Algorithm, by David Berlinski