RE: Calling conventions used by gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
> gcc is just a compiler, and doesn't determine the calling conventions:
> thse tend to be set by the OS being used.
>

This makes no sense to me... stdcall, cdecl, etc. (wherever they're defined/documented, which,
I believe, is the question) will indeed define an order for arguments, handling of CPU flags, and whether the caller or callee cleans up the stack.  Since the compiler must generate and maintain the stack frame (function prolog and epilog), how is it not "determined" / implemented by the compiler?  Admittedly, gcc may not directly "define" the calling convention (because it may adopt an existing definition - perhaps defined in some "ABI" - which is appropriate, since it is architecture-specific), but, ultimately, it must implement according to some definition.  So, where is it documented that for architecture "X", gcc is using the calling conventions defined in "Y", and these calling conventions are selected by using linkage specification / keyword "Z"?  (Some architectures may support more than one calling convention, although gcc could arbitrarily decide not to implement more than one.)  Also, I have found precious little formal documentation on ABIs (Itanium is the exception) - they tend to be more of a convention that is seemingly not well documented (other than "folklore" in mailing lists and the code implementations themselves), so if it is defined by an ABI, could someone point me in the direction of the documentation for that ABI?  ("please" and "thank you"!)

I'm personally interested in IA-32, but I believe the original poster was looking for IA-64.

>
> http://www.freestandards.org/ is the place to look. 
>

What exactly am I looking for here?  This looks like a collection of standards and forums, and searching the site for "C++ calling convention" yields a lot of hits, but nothing definitive.

Thanks again for your assistance.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux