[Expat-bugs] [ expat-Bugs-923913 ] Calling convention problems

SourceForge.net noreply at sourceforge.net
Fri Mar 26 09:33:19 EST 2004


Bugs item #923913, was opened at 2004-03-26 09:33
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=923913&group_id=10127

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Karl Waclawek (kwaclaw)
Assigned to: Karl Waclawek (kwaclaw)
Summary: Calling convention problems

Initial Comment:
Two problems I found in Windows, when trying to define 
XMLCALL as __stdcall:

1) 
In Expat.h, this struct is defined:

typedef struct {
  int map[256];
  void *data;
  int (XMLCALL *convert)(void *data, const char *s);
  void (XMLCALL *release)(void *data);
} XML_Encoding;

in xmltok.h, this function pointer is defined:

  typedef int (*CONVERTER) (void *userData, const char 
*p);

which maps to the third struct member.
So, if the calling convention in XMLCALL is different from
the default, we have a type mismatch.

2) 
In expat.h, we define the calling convention for
the memory handling function pointers like this:

typedef struct {
  void *(XMLCALL *malloc_fcn)(size_t size);
  void *(XMLCALL *realloc_fcn)(void *ptr, size_t size);
  void (XMLCALL *free_fcn)(void *ptr);
} XML_Memory_Handling_Suite;

However, when none are provided by the application, 
we are assigning the standard memory allocation 
functions to it. Which creates a problems, as these 
always have the same calling convention.

Suggested solutions:
1) Remove external API definitions from expat.h and
move them into a file external.h, that can be included
by other files that also have a dependency on the 
external API.

2) Remove XMLCALL from the function pointer
definitions in the memory handling struct.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=923913&group_id=10127



More information about the Expat-bugs mailing list