From: SourceForge.net <no...@so...> - 2009-11-22 00:58:40
|
Bugs item #491476, was opened at 2001-12-11 08:54 Message generated for change (Comment added) made by wsfulton You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=491476&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: parsing Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: John-Mark Gurney (jmg) >Assigned to: William Fulton (wsfulton) Summary: doesn't parse some struct's Initial Comment: SWIG when parsing some structs can't handle them properly. If you have something like this: struct { struct { int a; } a, b; } a; Which is legal in C, SWIG will complain of a parse error. If you replace it with: struct { struct { int a; } a; struct { int a; } b; } a; It will be parsed properly and you get the same results with a slight code bloat and struct assignment compatability. Attached is a test case. test.i shows the problem, test.iok shows how to fix it. Running: hydrogen,ttypo,/tmp/sw,541$swig -version SWIG Version 1.3.9u-20011208-0950 Copyright (c) 1995-1998 University of Utah and the Regents of the University of California Copyright (c) 1998-2001 University of Chicago Compiled with CC To run test case: swig -python -shadow test.i #notice syntax error swig -python -shadow test.iok make -f Makefile.pre.in boot make ---------------------------------------------------------------------- >Comment By: William Fulton (wsfulton) Date: 2009-11-22 00:58 Message: Now fixed in svn. Closing SWIG's oldest bug!! ---------------------------------------------------------------------- Comment By: Olly Betts (olly) Date: 2006-09-20 07:19 Message: Logged In: YES user_id=14972 I just had a look at this, as it's the oldest bug still open and is approaching its fifth anniversary! This bug still seems to exist in CVS HEAD (between 1.3.29 and 1.3.30). Incidentally, a better workaround is to give the nested struct a name and declare it beforehand like so: %module test %{ struct dummy { int a; int b; }; struct a { struct dummy d, e; }; %} struct dummy { int a; int b; }; struct a { struct dummy d, e; }; ---------------------------------------------------------------------- Comment By: David M. Beazley (beazley) Date: 2002-05-25 20:04 Message: Logged In: YES user_id=7557 Still a bug in 1.3.12. Will resolve when we fix nested classes in SWIG 1.3.13. ---------------------------------------------------------------------- Comment By: John-Mark Gurney (jmg) Date: 2001-12-12 09:00 Message: Logged In: YES user_id=27410 I have confirmed that this still exists with 1.3.10: hydrogen,ttypr,/tmp/sw,503$swig -python -shadow test.i Syntax error test.i:16. Syntax error in input. test.i:17. Syntax error in input. test.i:22. Missing semicolon. Reached end of input. test.i:22. Syntax error in input. hydrogen,ttypr,/tmp/sw,504$swig -version SWIG Version 1.3.10u-20011212-0051 Copyright (c) 1995-1998 University of Utah and the Regents of the University of California Copyright (c) 1998-2001 University of Chicago Compiled with CC ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=491476&group_id=1645 |