"Theo R." <sh*************@gmail.comwrote in message
news:11*********************@e65g2000hsc.googlegro ups.com...
Does the C99 Standard explicitly mention the need for a stack for
passing arguments or Is this platform specific?
As an example, the ARM9 processor recommends Core
Registers R0-R3 be used when passing less than four
parameters. However some compilers for ARM9 do not follow
this recommendation and place all parameters on the stack.
Therefore, the question arises if the compilers were following
the C Standard instead.
The C Standard says nothing about this, nor does it require that an
implementation have "registers" or a "stack" (or a "heap") at all.
Each platform (OS/CPU combination) does tend to have an Application Binary
Interface (ABI) standard, and compilers/linkers are expected to conform to
that. However, the ABI is not part of the C Standard, so an implementation
can disregard the accepted ABI and still be conforming according to
ISO/ANSI.
(Some ABIs, e.g. x86, even define multiple calling conventions, but they'll
specify one as the default. It's up to the programmer to make sure the
right compiler extensions or options are used if a non-default calling
convention is needed.)
S
--
Stephen Sprunk "Those people who think they know everything
CCIE #3723 are a great annoyance to those of us who do."
K5SSS --Isaac Asimov
--
Posted via a free Usenet account from
http://www.teranews.com