参数通过堆栈传递 [英] Parameter Passing via a Stack

查看:78
本文介绍了参数通过堆栈传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


C99标准是否明确提到需要为
传递参数的堆栈?或者这个平台是否具体?


例如,ARM9处理器建议在传递少于四个参数时使用核心寄存器R0-R3

。但是ARM9的一些编译器

不遵循这个建议并将所有参数放在

堆栈上。因此,问题是编译器是否遵循C标准而是




我记得评估顺序是从右到左。这部分是

的标准还是实施细节?


谢谢,

Theo。

解决方案

Theo R.写道:


大家好,


C99标准是否明确提到需要为
传递参数的堆栈?或者这个平台是否具体?



不,这是一个实施细节。


-

Ian Collins。


4月下午1:30,Theo R. <短视... @ gmail.comwrote:


大家好,


C99标准是否明确提到需要对于

传递参数的堆栈或该平台是否具体?



No.


我记得evaludation的顺序是从右到左。

的这一部分是标准还是实施细节?



错误。评估顺序没有具体说明。


为什么你不拿自己的标准副本看看自己?
http://www.open-std.org/JTC1/SC22/WG ... docs / n1124.pdf


-Sharath


4月2日凌晨1:30 ,Theo R. <短视...... @ gmail.comwrote:


>

C99标准是否明确提到需要堆栈

传递参数或这个平台是否具体?



这是一个实现细节 - C根本不需要堆栈。


...


我记得evaludation的顺序是从右到左。

的这一部分是标准还是实施细节?



这是一个实现细节,不需要实现

来记录它。


Hi all,

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.

I remember that order of evaludation is right to left. Is this part of
the standard or is it an implementation detail?

Thanks,
Theo.

解决方案

Theo R. wrote:

Hi all,

Does the C99 Standard explicitly mention the need for a stack for
passing arguments or Is this platform specific?

No, it is an implementation detail.

--
Ian Collins.


On Apr 2, 1:30 pm, "Theo R." <shortsighted...@gmail.comwrote:

Hi all,

Does the C99 Standard explicitly mention the need for a stack for
passing arguments or Is this platform specific?

No.

I remember that order of evaludation is right to left. Is this part of
the standard or is it an implementation detail?

Wrong. Order of evaluation is unspecified.

Why don''t you get yourself a copy of standard and see yourself?
http://www.open-std.org/JTC1/SC22/WG...docs/n1124.pdf

-Sharath


On Apr 2, 1:30 am, "Theo R." <shortsighted...@gmail.comwrote:

>
Does the C99 Standard explicitly mention the need for a stack for
passing arguments or Is this platform specific?

It''s an implementation detail - C doesn''t need a stack at all.

...

I remember that order of evaludation is right to left. Is this part of
the standard or is it an implementation detail?

It''s an implementation detail, and the implementation is not required
to document it.


这篇关于参数通过堆栈传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆