|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Change in handling of nested structs from 1.3.36?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; ------------------------------------------------------------------------------ _______________________________________________ Swig-user mailing list Swig-user@... https://lists.sourceforge.net/lists/listinfo/swig-user |
|
|
Re: Change in handling of nested structs from 1.3.36?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; > 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 ------------------------------------------------------------------------------ _______________________________________________ Swig-user mailing list Swig-user@... https://lists.sourceforge.net/lists/listinfo/swig-user |
|
|
Re: Change in handling of nested structs from 1.3.36?On Thu, Jun 25, 2009 at 1:59 PM, William S Fulton <wsf@...> wrote:
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 |
|
|
|
|
|
Re: Change in handling of nested structs from 1.3.36?On Mon, Jun 29, 2009 at 5:58 PM, William S Fulton <wsf@...> wrote:
I now know what is causing the syntax error. In retrospect, I shouldn't have removed the comments from the module when I posted it earlier. The real module contains the doxygen end-of-line comment: /**< v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */ It appears that the '/' characters in the comment cause the syntax error. If I delete them, the problem goes away. The module with the problematic comment is attached. I'm still not sure why -Wallkw fails because the swig search paths are just as you described them, but I'm prepared to live without it. Thanks for all the help and sorry to have muddled the problem by sending the incomplete code. ------------------------------------------------------------------------------ _______________________________________________ Swig-user mailing list Swig-user@... https://lists.sourceforge.net/lists/listinfo/swig-user |
|
|
Re: Change in handling of nested structs from 1.3.36?Solomon Gibbs wrote:
> I now know what is causing the syntax error. In retrospect, I shouldn't > have removed the comments from the module when I posted it earlier. The > real module contains the doxygen end-of-line comment: > /**< v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked > datasets */ > > It appears that the '/' characters in the comment cause the syntax > error. If I delete them, the problem goes away. > > The module with the problematic comment is attached. > > I'm still not sure why -Wallkw fails because the swig search paths are > just as you described them, but I'm prepared to live without it. > Also just fixed in svn. William ------------------------------------------------------------------------------ _______________________________________________ Swig-user mailing list Swig-user@... https://lists.sourceforge.net/lists/listinfo/swig-user |
| Free embeddable forum powered by Nabble | Forum Help |