Announcement

Collapse
No announcement yet.

Help - Function calling conventions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help - Function calling conventions

    Can anyone help me understand the pros and cons of the different calling conventions? I read the help file, and I get the left to right vs right to left parameter passing thing... I also understand the clean up....called vs caller but...

    What I don't understand is why choose one over the other.

    I get that SDECL is "required" for calling the Win API, but beyond that, why would I every use BDECL or CDECL?

    Is there something wrong with using SDECL for everything?

    Would it not make sense to use CDECL for everythign except the WIN API?

    Why do we need BDECL at all?

    etc....

    any help is most appreciated...
    thanks,
    M

  • #2
    There is no advantage or disadvantage to any calling convention.

    Different standards emerged from the depths of time; many survive to this day; basically the same reason we share the planet with multiple species of cockroaches.
    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Michael is correct, as far as he takes it. There is no substantive difference in performance between calling conventions. In Windows, almost everyone now uses SDECL (STDCALL). However, we offer the others so you can be compatible with a DLL created with a more restrictive programming language. Use whatever suits your fancy.

      Bob Zale
      PowerBASIC Inc.

      Comment


      • #4
        ahh...I see...ok

        thanks...

        ok...so it really is just to be compatible with existing DLLs, older programs and such... I suspected that for BDECL, but I figure there might be some advantage to CDECL over SDECL in some cases .... oh well....

        I suppose just using SDECL will work most of the time as a defacto standard...

        Comment

        Working...
        X