« Return to Thread: Change in handling of nested structs from 1.3.36?

Re: Change in handling of nested structs from 1.3.36?

by Solomon Gibbs-3 :: Rate this Message:

Reply to Author | View in Thread

On Thu, Jun 25, 2009 at 1:59 PM, William S Fulton <wsf@...> wrote:
Solomon Gibbs wrote:
I have a rather nasty struct in the code I'm wrapping. Though version 1.3.36, swig has always consumed it without complaining. However, I recently downloaded 1.3.39 and now I get a syntax error at the line corresponding to the end of the "meta_size" struct (below). The preprocess result from running swig with -E looks like more or less what I would expect.

Does anyone have any idea what has changed, or how to figure out I am doing wrong? I've tried a couple of the --debug-* options, but the parse seems to stop before they can have any effect.

Any help would be appreciated.

The following struct doesn't seem to work under 1.3.38 or 1.3.39. I haven't checked 1.3.37.

typedef struct H5O_info_t {
   unsigned long     fileno;
   haddr_t         addr;
   H5O_type_t         type;
   unsigned         rc;
   time_t        atime;
   time_t        mtime;
   time_t        ctime;
   time_t        btime;
   hsize_t         num_attrs;
   struct {
       unsigned version;
       unsigned nmesgs;
       unsigned nchunks;
       unsigned flags;
       struct {
           hsize_t total;
           hsize_t meta;
           hsize_t mesg;
           hsize_t free;
       } space;
       struct {
           uint64_t present;
           uint64_t shared;
       } mesg;
   } hdr;
   struct {
       H5_ih_info_t obj;
       H5_ih_info_t attr;
   } meta_size;
} H5O_info_t;

I don't get any error using this struct and I don't see any problems using valgrind on SWIG for this struct. I think the best thing is for you to provide the exact commandline options you are passing to SWIG and provide a complete standalone interface file that shows the problem. Also which operating system, compiler and compile options you used to compile SWIG.

William

The minimum module that causes the problem seems to be the struct itself. (attached, for completeness)

My swig commandline is:
/c/opt/swig/swigwin-1.3.39/swig.exe -java -package "permafrost.hdf.libhdf" -outdir "target/swig-java/permafrost/hdf/libhdf"  src/swig/H5O_info_t.i
src\swig\H5O_info_t.i(34): Error: Syntax error in input(3).

I am using the pre-build windows binaries from sourceforge; unzipped and used as-provided. But I have reason to suspect my install is misconfigured somehow anyway: If I try to run swig with -Wallkw, it fails while trying to load php.swg:

 /c/opt/swig/swigwin-1.3.39/swig.exe  -Wallkw  -java -package "permafrost.hdf.libhdf" -outdir "target/swig-java/permafrost/hdf/libhdf"  src/swig/H5O_info_t.i
c:\opt\swig\swigwin-1.3.39\Lib\php\php.swg(13): Error: Unable to find 'phpinit.swg'
c:\opt\swig\swigwin-1.3.39\Lib\php\php.swg(15): Error: Unable to find 'globalvar.i'
c:\opt\swig\swigwin-1.3.39\Lib\php\php.swg(16): Error: Unable to find 'const.i'
c:\opt\swig\swigwin-1.3.39\Lib\php\php.swg(38): Error: Unable to find 'utils.i'
c:\opt\swig\swigwin-1.3.39\Lib\php\php.swg(311): Error: Unable to find 'phpkw.swg'
 



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

_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

H5O_info_t.i (2K) Download Attachment

 « Return to Thread: Change in handling of nested structs from 1.3.36?