[fpc-pascal] Weird absence of compilation error

OBones obones at free.fr
Thu Mar 21 10:53:14 CET 2013


Hello all,

I'm using FPC 2.6.0 and have the following test program :

program test;

function Element: Double;
begin
   Result := 4;
end;

function Tmp: Double;
begin
   Result := 10; + Element;
end;

begin
   WriteLn(Tmp);
end.

And quite surprisingly to me, both ppc386 and pccrossx64 compile it 
successfully in Delphi mode!
What's even weirder is that if I replace the Plus operator by a Minus 
operator, then the compilation fails.
What I was expecting is that the compilation fails in all cases.
Is there some flag that I failed to specify?

Regards
OBones



More information about the fpc-pascal mailing list