How to disable a warning in Delphi about "return value ... might be undefined"?

Posted by Lasse V. Karlsen on Stack Overflow See other posts from Stack Overflow or by Lasse V. Karlsen
Published on 2008-09-14T15:40:38Z Indexed on 2010/05/25 16:51 UTC
Read the original article Hit count: 225

Filed under:
|
|

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 shot, so I can't pop up the help for that warning right now.

Anyone know off the top of their head what I can do?

© Stack Overflow or respective owner

Related posts about delphi

Related posts about warnings