I have a function that gives me the following warning:
[DCC Warning] filename.pas(6939): W1035 Return value of function 'function' might be undefined
The function, however, is clean, small, and does have a known, expected, return value. The first statement in the function is:
Result := '';
and there is no local variable or parameter called Result
either.
Is there any kind of pragma-like directive I can surround this method with to remove this warning? This is Delphi 2007.
Unfortunately, the help system on this Delphi installation is not working, therefore i can't pop up the help for that warning right now.
Anyone know off the top of their head what i can do?
Are you sure you have done everything to solve the warning? Maybe you could post the code for us to look at?
You can turn off the warning locally this way:
{$WARN NO_RETVAL OFF}
function func(...): string;
begin
...
end;
{$WARN NO_RETVAL ON}
I am not sure that I want to see the code for this unit... after all, the error occurs at line 6939 ... Maybe some internal compiler table have been exceeded?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With