[fpc-devel] [patch] regex.pp with out parameters

Joost van der Sluis joost at cnoc.nl
Fri Mar 27 12:57:34 CET 2009


Op vrijdag 27-03-2009 om 12:55 uur [tijdzone +0200], schreef Graeme
Geldenhuys:
> Hi,
> 
> Please find attached a minor patch that removes the following compiler
> hints when TRegexEngine.Parse(...) is used.
> 
> ================
> iterator_impl.pas(306,46) Hint: Local variable "LErrorCode" does not
> seem to be initialized
> iterator_impl.pas(306,34) Hint: Local variable "LErrorPos" does not
> seem to be initialized
> ================
> 
> The patch simply changes the 'var' parameters to 'out' parameters.

It surely fixes the warning, but not the problem? Doesn't 'out' generate
faster code in this case? And shoudn't the error be always set? To 0 if
no error occured or something else if there really is an error?

(I didn't look at the code yet)

Joost.





More information about the fpc-devel mailing list