You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Nik Clayton <ni...@ngo.org.uk> on 2007/03/03 17:52:37 UTC

Re: SWIG not generating correct type qualifiers

Nik Clayton wrote:
> Has anyone experienced problems with Swig not generating correct type 
> qualifiers?

[...]

  > If you try and pass anything that fits in an unsigned 32 bit int, but
> not a signed 32 bit int (eg., 0xffffffff), the check at the line marked 
> "/* check */" will fail, and SWIG_OverflowError is returned.

This appears to be SWIG bug 1481958.

http://sourceforge.net/tracker/index.php?func=detail&aid=1481958&group_id=1645&atid=101645

I'd be grateful if people could try the following:

   svn checkout 
http://svn.collab.net/repos/svn/branches/perl-bindings-improvements

   cd perl-bindings-improvements
   ./autogen.sh
   ./configure \
     --enable-maintainer-mode \
     --enable-debug \
     --without-neon \
     --without-berkeley-db
   gmake MAKE=gmake
   gmake MAKE=gmae swig-pl

(the MAKE=gmake bit is necessary on platforms where GNU make is not 
"make", if that's not the case on your platform then just "make; make 
swig-pl" should suffice).

Then

   cd subversion/bindings/swig/perl/native
   perl Makefile.PL
   make
   perl -Iblib/arch -Iblib/lib t/client/list.t

I expect that on 32 bit platforms that test will fail, and on 64 bit 
platforms it will succeed.  I've only got a 64 bit platform available at 
the moment, and I want to make sure the problem is definitely there on 
32 bit platforms before I work on a fix.

Many thanks,

N

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: SWIG not generating correct type qualifiers

Posted by Malcolm Rowe <ma...@farside.org.uk>.
Hi Nik,

On Sat, Mar 03, 2007 at 05:52:37PM +0000, Nik Clayton wrote:
>   gmake MAKE=gmae swig-pl
> 
> (the MAKE=gmake bit is necessary on platforms where GNU make is not 
> "make", if that's not the case on your platform then just "make; make 
> swig-pl" should suffice).
> 
> Then
> 
>   cd subversion/bindings/swig/perl/native
>   perl Makefile.PL
>   make

(That was run for me when I did the 'make swig-pl'.  I assume that's
normal).

>   perl -Iblib/arch -Iblib/lib t/client/list.t
> 

Works fine for me on a 32-bit Pentium 3 running Slackware:
(SWIG 1.3.29, Perl 5.8.8, APR 1.2.7).

$ uname -a
Linux lorenz 2.4.33.3 #1 Fri Sep 1 01:48:52 CDT 2006 i686 pentium3 i386
GNU/Linux
$ swig -version

SWIG Version 1.3.29

Compiled with g++ [i686-pc-linux-gnu]
...
$ perl -Iblib/arch -Iblib/lib t/client/list.t
1..19
ok 1 - use Test::SVN;
ok 2 - use SVN::Client;
ok 3 - The object isa SVN::Client
ok 4 - $path is correct -
ok 5 - The object isa _p_svn_dirent_t
ok 6 - $lock is undefined
ok 7 - $abs_path is correct - /
ok 8 - The object isa _p_apr_pool_t
ok 9 - $path is correct - A
ok 10 - The object isa _p_svn_dirent_t
ok 11 - $lock is undefined
ok 12 - $abs_path is correct - /
ok 13 - The object isa _p_apr_pool_t
ok 14 - $path is correct - iota
ok 15 - The object isa _p_svn_dirent_t
ok 16 - $lock is undefined
ok 17 - $abs_path is correct - /
ok 18 - The object isa _p_apr_pool_t
ok 19 - $list_func called 3 times


I did have to apply a patch to get the Perl bindings to build at all, so
it's possible that may have worked around the problem:

The build problem I had was that it's not possible for me to #include
the APR headers unless I include the flags from 'apr-config --cppflags',
because otherwise apr_off_t is typedef'd to off64_t, and the latter
isn't defined.

Including the relevant flags from apr-config (in my case,
-D_LARGEFILE64_SOURCE) fixes the problem.  The attached patch replaces
the default set of MakeMaker CCFLAGS with the set defined by 'apr-config
--cpp-flags --cflags'.  I have no idea whether it's correct generally,
but I can't build the bindings otherwise.

Regards,
Malcolm