[Gambas-devel] GB.ReturnNewString() in gb.pcre

Tobias Boege tobias at ...692...
Mon Dec 9 20:31:43 CET 2013


On Mon, 09 Dec 2013, Beno?t Minisini wrote:
> Le 09/12/2013 19:42, Tobias Boege a ?crit :
> > Hi Benoit,
> >
> > there is a call to GB.ReturnNewString() in gb.pcre which generates annoying
> > advices not to use it but to use GB.ReturnNewZeroString() instead. Does this
> > make sense? GB.ReturnNewString() seems to be the better way in that case...
> 
> I should have fixed that in revision #5992 for gb.pcre.
> 
> The warning message is printed when the "length" argument of 
> GB.ReturnNewString() is lower or equal than zero, because it won't 
> return a null string but compute the string length with strlen() (this 
> is a backward-compatibility with older versions of the interpreter API).
> 
> If you want to return a void string, use GB.ReturnVoidString() as I did 
> in gb.pcre.
> 
> If you are using the old syntax of GB.ReturnNewString(), use 
> GB.ReturnNewZeroString() instead.
> 

OK, the message didn't say that this is about the length parameter. I
thought GB.ReturnNewString() would be deprecated in a next version or so...

I use it only with positive lengths.

Regards,
Tobi





More information about the Devel mailing list