Sign in Join

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

Mailing lists / fpc-pascal / 2007-11

cdecl or stdcall on WinCE for ARM

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Adrian Veith

Hi,

what is the right calling convention for using system libraries on wince for ARM ?

I wrote a pascal wrapper for a system dll and used stdcall for the calling convention - and the program worked.
I changed to cdecl - and the program works as well.

In my opinion the program should have crashed on one of the two.

Now I am puzzled.

Cheers,

Adrian.

Henry Vermaak
to Adrian Veith
Adrian Veith wrote 11 lines
Hi, what is the right calling convention for using system libraries on wince for ARM ? I wrote a pascal wrapper for a system dll and used stdcall for the calling convention - and the program worked. I changed to cdecl - and the program works as well. In my opinion the program should have crashed on one of the two.

i guess those calling conventions don't exist on arm. the compiler probably just ignores them and chooses the default one. there should be a warning/note for this, imho. gcc does do that, iirc.

(i think arm only has a "normal" and a soft fpu calling convention)

Show quoted text 5 lines
Now I am puzzled. Cheers, Adrian.

henry

Florian Klaempfl
to Adrian Veith: what is the right calling convention for using system libraries on wince for ARM ? I…
Show quoted text 13 lines
Hi, what is the right calling convention for using system libraries on wince for ARM ? I wrote a pascal wrapper for a system dll and used stdcall for the calling convention - and the program worked. I changed to cdecl - and the program works as well. In my opinion the program should have crashed on one of the two. Now I am puzzled.

Both are equal on arm, you could even use register and things won't change.

Adrian Veith
to Florian Klaempfl
Show quoted text 19 lines
Adrian Veith schrieb: > Hi, > > what is the right calling convention for using system libraries on wince > for ARM ? > > I wrote a pascal wrapper for a system dll and used stdcall for the > calling convention - and the program worked. > I changed to cdecl - and the program works as well. > > In my opinion the program should have crashed on one of the two. > > Now I am puzzled. > > Both are equal on arm, you could even use register and things won't change.

I have guessed something like that - otherwise it would be impossible.

Thanks,

Adrian.