axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dimuthu Gamage" <>
Subject Re: WSDL2C: structure definition is generated in C file so sizeof fails compilation
Date Mon, 21 Apr 2008 13:49:37 GMT
Hi alebu,
It is really encouraged to use adb_my_type_create instead of
explicitly using malloc to create the adb objects. I think create/free
function should be completely able to fulfill your needs in managing
object life.


On Mon, Apr 21, 2008 at 6:08 PM, alebu <> wrote:
> 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 now?
> If so, then what is that motivation? And how then to get size of structure?
>  I think It is code generator bug so thats why I actually write that letter.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message