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

Benoît Minisini gambas at ...1...
Mon Dec 9 20:08:59 CET 2013


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.

-- 
Benoît Minisini




More information about the Devel mailing list