[fpc-pascal] Firebird +lin32 + fpc lib udf returns garbage.

Coco Pascal coco.pascal at xs4all.nl
Mon Jun 1 14:39:24 CEST 2009


Jonas Maebe wrote:
>
> On 01 Jun 2009, at 12:30, Jonas Maebe wrote:
>
>> On 01 Jun 2009, at 11:40, Coco Pascal wrote:
>>
>>> It looks as if the code isn't executed at all. Maybe Firebird 
>>> requires PIC.
>>
>> That is extremely unlikely (I'd say "impossible", but that's 
>> dangerous). Whether or not the code in the library is 
>> position-independent is something Firebird has no clue about (unless 
>> it starts disassembling the library and/or reading the relocation 
>> information).
>
> Not to mention that it would make no difference for the function you 
> posted, since it does not refer to any other code nor to global data.
>
This made me start a test again with a clean sheet and guess...

function VV(const AValue: LongInt): LongInt; cdecl; export;
begin
Result := AValue;
end;

works fine now.
But if I add the following function it returns wrong results. This one 
does refer to other code.

function Y_Odd(const AValue: LongInt): LongInt; cdecl; export;
begin
if Odd(AValue) then
Result := -1
else
Result := 0;
end;




More information about the fpc-pascal mailing list