Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2018-10

odd compiling + linking error (with invalid casting of Exp)

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dmitry Boyarintsev

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
to Dmitry Boyarintsev
PM Dmitry Boyarintsev wrote
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

Same with fpc trunk r39843.

Bart