Discussion:
[fpc-pascal] odd compiling + linking error (with invalid casting of Exp)
Dmitry Boyarintsev
2018-10-29 16:48:35 UTC
Permalink
I'm using 3.0.4 (win32), could any one try it on a later version of the
compiler?

The code i'm compiling looks like this:
--------------
{$mode delphi}

type
Ttest = class(TObject)
public
Value: string;
end;

function Custom: extended;
begin
Result := 0;
end;

begin
// writeln( TTest(Custom).Value );
writeln( TTest(Exp).value);
end.
--------------
It gives the linking error:
sample.pas(17,1) Error: Undefined symbol:
SYSTEM_::=::\_EXP$EXTENDED::=::\EXTENDED
sample.pas(17,1) Fatal: There were 1 errors compiling module, stopping

If one un-comments the line with invalid Custom() cast, they would get a
compiling error instead:
Compiling sample.pas
sample.pas(15,12) Error: Illegal type conversion: "Extended" to "Ttest"
(which is expected).

Is the issue known? worth bug reporting?
(clearly a compiler error should be thrown, rather than a linker error)

The issue I actually ran into is with a bigger project:
Error: Undefined symbol: SYSTEM_::=::\_EXP$EXTENDED::=::\EXTENDED
doesn't indicate the source code or line numbers.
So catching the problem might be tricky.

thanks,
Dmitry
Bart
2018-10-30 13:24:29 UTC
Permalink
On Mon, Oct 29, 2018 at 5:49 PM Dmitry Boyarintsev
sample.pas(17,1) Error: Undefined symbol: SYSTEM_::=::\_EXP$EXTENDED::=::\EXTENDED
sample.pas(17,1) Fatal: There were 1 errors compiling module, stopping
Same with fpc trunk r39843.

Bart
_______________________________________________
fpc-pascal maillist - fpc-***@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailma

Loading...