logo       

Re: bug while wrapping const char arrays without an explicitly defined size: msg#00171

programming.swig

Subject: Re: bug while wrapping const char arrays without an explicitly defined size

Marcelo Matus writes:
> >Where is SWIG_FromCharArray() coming from? I don't remember that
> >function being part of the SWIG API (I sure didn't write it anyways).
> >
> >SWIG developers: Is there some reason the normal PyObject API
> >functions are not being used here???
> >
> >
> >
>
> Most of the PyObject API functions don't check for NULL pointers, and
> if you pass one, python crashes. Also, internally python uses
> 'int' for size, which means if you have a very large binary string
> python can't handle it.
>
> The extra SWIG_XXX methods check for null when needed and
> return you a plain pointer (not a python string) if the array size
> is larger than INT_MAX.
>

IMHO, both of these problems sound like issues that can be resolved
using user-defined typemaps and are not necessary for SWIG's default
behavior.

-- Dave
_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise