[fpc-devel] Compiler bug?

Paul van Helden paul at planetgis.co.za
Sun Jan 31 09:04:55 CET 2010

Of course.... Thanks Cobines!

I have never used the function name instead of "Result", but of course 
you can. Using () after a function to me seems so C-like and 
un-Pascallish but it works.

But it is things like this that trip up people coming from Delphi, I 
guess. Isn't this a potential improvement to the compiler though: scan 
for overloaded functions before assuming that it is the result value 
(like Delphi does)? (Or warn about overloaded functions without 
parameters, similar to mode objfpc disallowing parameter names that are 
the same as methods?)

On 2010/01/31 09:46 AM, cobines wrote:
> Isn't the "GetValue_overloaded" in
>    1: Result:=GetValue_overloaded
> the return value of the function?
> Maybe you should call it this way:
> Result:= GetValue_overloaded()
> That's why I think you get the warning.
> The reason you might be getting random results is that the return
> value has not been initialized.

More information about the fpc-devel mailing list