axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lefrancois, Carl" <>
Subject RE : WSDL2C: structure definition is generated in C file so sizeof fails compilation
Date Mon, 21 Apr 2008 13:25:49 GMT
Hi Alebu,
I may be mistaken, but there will be some type redefinition problems if
the struct is defined in a header that is included by many other files.
Is it possible to create an instance of the struct and use sizeof() on
that at run-time?  HTH

	-----Message d'origine-----
	De : alebu [] 
	Envoyé : lundi, avril 21, 2008 08:38
	À : Apache AXIS C User List
	Objet : WSDL2C: structure definition is generated in C file so
sizeof fails compilation
	Hi, I am generating web service using WSDL2C. In generated code
I got such a division of sources:
	In header (.h) file i got type declaration like:
	typedef struct adb_my_type adb_my_type_t;
	But adb_my_type structure is located in source file (.c):
	struct adb_my_type {
	   // declaration of my_type
	Such a location of sources creates a problem when I trying to
allocate memory for such a structure.
	sizeof(adb_my_type_t) fails with incomplete type ...
	As I understand, it happens because compiler can't discover
exact size of structure from header, because actual information
	is available only from source file.
	I moved declaration to header like:
	struct adb_my_type {
	   // declaration of my_type
	typedef struct adb_my_type adb_my_type_t;
	And now everything works fine, so I think that it is better to
generate code in such way.
	Or maybe there is some motivation to do it like it is made for
	If so, then what is that motivation? And how then to get size of
	I think It is code generator bug so thats why I actually write
that letter.

"Ce message est confidentiel, à l'usage exclusif du destinataire
ci-dessus et son contenu ne représente en aucun cas un engagement de la
part de AXA, sauf en cas de stipulation expresse et par écrit de la part
de AXA. Toute publication, utilisation ou diffusion, même partielle,
doit être autorisée préalablement. Si vous n'êtes pas destinataire de ce
message, merci d'en avertir immédiatement l'expéditeur."

"This e-mail message is confidential, for the exclusive use of the
addressee and its contents shall not constitute a commitment by AXA,
except as otherwise specifically provided in writing by AXA. Any
unauthorized disclosure, use or dissemination, either whole or partial,
is prohibited. If you are not the intended recipient of the message,
please notify the sender immediately."

View raw message