Jonas Maebe wrote:
It's a bug in the compiler. Please submit a bug report with a compilable sample that demonstrates the problem.


Jonas,

Thanks much for the reply. I will submit a bug report ASAP. I spent most of the morning trying to simplify the error case, and came up with the following:

---

library project1;

uses
Classes;

function dRound(iDec: integer; dRate: double): double;
const
  TenToPower: Array[0..9] of integer = (1, 10, 100, 1000, 10000, 100000,
1000000, 10000000, 100000000, 1000000000);
var
  dInc : double;
begin
  if iDec > 0 then begin
     dInc := 0.5000001;
     result := trunc (dRate * (TenToPower [iDec]) + dInc) /
        TenToPower [iDec];
  end else begin
     result := dRate;
  end ;
end;

function one : double; cdecl;
begin

  Result := dRound( 2, 0.529 ) ;

end;

---

Trying to compile this under fpc 2.1.4 on x86_64 via "fpc -Sd proj.pas" gives me the following results:

Compiling proj.pas
Linking libproj.so
/usr/bin/ld: proj.o: relocation R_X86_64_32S against `TC_P$PROJECT1_DROUND$LONGINT$TROUNDTYPE$DOUBLE$$DOUBLE_TENTOPOWER' can not be used when making a shared object; recompile with -fPIC
proj.o: could not read symbols: Bad value

I'll sign up for an account and post the ticket now.

Thanks much,
 Alan

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to