Debugging my code, I noticed that the Delphi compiler (Berlin 10.1) does not warn about functions which are without a return value. Is this normal?
A simple example:
function f(s:string):String;
begin
stringreplace(s,#32,'',[rfReplaceAll]);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
showmessage(F('te st'));
end;
this line
stringreplace(s,#32,'',[rfReplaceAll]);
Should be
result:= stringreplace(s,#32,'',[rfReplaceAll]);
No warning!
I think it should warn "return value might be undefined". But it does not. I changed and rewrote some part of old codes in last days. I am afraid I have this kind of mistake in my application.