[fpc-devel] Windows 32bit - FPC 3.0.4 Gets an Error - but not on Linux or Mac...

Ozz Nixon ozznixon at gmail.com
Sat Sep 28 22:52:33 CEST 2019


It's a CDECL thing... :-(

Disabled Using_CDECL, and now the pointer passes to/from the imported
functions. (Florian/Jonas/Michael - is this an expected issue on Windows?)

On Sat, Sep 28, 2019 at 3:24 PM Ozz Nixon <ozznixon at gmail.com> wrote:

> Alexander, Its the calling line that is messing up.
>
> TLapeImportedFunc(Ptr)(@Stack[StackPos - ParamSize], Res);
>
> * Res has a value before executing that line. However, the called method
> receives the 2nd param as null.
>
> Or is it in the definition:
> TLapeImportedFunc = procedure(const Params: PParamArray; const Result:
> Pointer); {$IFDEF Using_CDECL}cdecl;{$ENDIF} <-- CDECL is enabled.
>
> So, is a CDECL thing? A compile switch I need to enable/disable? Remove
> "const" everywhere? ... it has taken me 6 months to slow down and say, WTF.
> I can run everywhere but Windows. :-(
>
> On Sat, Sep 28, 2019 at 3:16 PM Alexander Grotewohl <alex at dcclost.com>
> wrote:
>
>> don't know off the top of my head but does the ord() bit segfault without
>> assigning it to anything? like if the function only had writleln(ord())! or
>> does the result:= section segfault using ord() without the pointers?
>>
>> my guess is it works on linux/mac purely by luck. but i could be wrong.
>>
>> --
>> Alexander Grotewohl
>> http://dcclost.com
>>
>> On Sep 28, 2019 3:21 PM, Ozz Nixon <ozznixon at gmail.com> wrote:
>>
>> [image: image.png]
>>
>> When I evaluate the code - it is perfect. However, when I run the code,
>> it raises a SIGSEGV - Segmentation fault. Yet, the code runs perfectly on
>> Linux 64bit machine, and Mac 32bit.
>>
>>
>> _______________________________________________
>> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
>> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190928/6a6701c4/attachment-0001.html>


More information about the fpc-devel mailing list