违反程序调用约定 [英] violating procedure calling convention

查看:58
本文介绍了违反程序调用约定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




任何编程语言的语法都说当一个函数被另一个函数调用时,被调用者执行它后会被调用身体应该

返回它留在呼叫者的位置..

是否有任何技术让被叫者返回其他人

点(在当前进程内)通过改变

被调用者的调用栈...

我的代码在86处理器上运行

(如果这个帖子对这个组无关紧要请恭喜

一样)

提前感谢

解决方案

在文章< 11 ********************** @ y80g2000hsf.googlegroups .com> ;,

KIRAN< ki ***** @ gmail.comwrote:


> hi,

任何语法编程语言表示当一个函数被另一个函数调用时,被调用者在执行它的主体之后应该返回它在调用者中留下的位置..



语法说没有这样的事情。语法只描述语法;

运行时发生的事情是语义问题。


>是否有任何技术可以使通过更改被叫方中的调用堆栈,callee返回到被调用者以外的其他点(在当前进程内)...



使用INTERCAL,它有一个COME FROM语句就是为了这个目的。


或者,使用函数式编程语言,让你使用

显式延续并调用继续而不是返回。


如果你努力的话,这两个都可以用(正确的,便携的)C来完成,

但你不要''我想做那件事。要么重新设置问题以适应您的

工具,要么选择适合您问题的工具。

dave


-

Dave Vandervies dj******@csclub.uwaterloo.ca


他不会以某种方式打击我作为学习者。让我们希望我们错了。

- 在comp.lang.c中的理查德希思菲尔德


2007年4月13日星期五,Dave Vandervies写道:


文章< 11 ********************** @ y80g2000hsf .googlegroups .com>,

KIRAN< ki ***** @ gmail.comwrote:


> hi,



语法说没有这样的事情。语法只描述语法;

运行时发生的事情是语义问题。


>是否有任何技术可以使通过更改被叫方中的调用堆栈,被叫方返回到被调用者以外的其他点(在当前进程内)...



使用INTERCAL,它有一个COME FROM语句就是为了这个目的。


或者,使用函数式编程语言,让你使用

显式延续并调用继续而不是返回。


如果你努力的话,这两个都可以用(正确的,便携的)C来完成,

但你不要''我想做那件事。要么重新构建问题以适应您的

工具,要么选择适合您问题的工具。



我不太同意这种反转向的心态。


在某些情况下,setjmp和longjmp是实际上好于

重新解决这个问题。


德成


文章< Pi *******************************@scorpio.gold.ac .uk> ;,

德-Shing Chan< t。**** @ gold.ac.ukwrote:


> 2007年4月13日星期五,Dave Vandervies写道:


>在文章< 11 ********************** @ y80g2000hsf.googlegroups .com>中,
KIRAN< ki ***** @ gmail.comwrote:


>>是否有任何技术可以通过更改调用堆栈来使被调用者返回到被调用者以外的其他点(在当前进程内)被叫...


使用INTERCAL,它有一个COME FROM语句用于此目的。

或者,使用函数式编程语言,它允许您使用
显式延续并调用延续而不是返回。 br />
这两个都可以在(正确,便携)C中完成,如果你足够努力,
但你不想这样做。要么重新设置问题以适应您的
工具,要么选择适合您问题的工具。



我不太同意这种反转向的心态。



我在这里看不到反goto心态。


在某些情况下,setjmp和longjmp实际上比重新解决问题更好。



没有足够的信息可以肯定,但问题的方式是b / b
是一个非常强烈暗示的OP正在寻找一些东西

比setjmp / longjmp更少限制。

dave


-

Dave Vandervies dj******@csclub.uwaterloo.ca

那个只告诉你执行的时间。要计算速度,你将需要知道程序在那段时间内的行程距离。

- 在comp.lang.c中的理查德希思菲尔德


hi,

the grammer for any programming language says that when a function is
called by another function,the callee after executing it''s body should
return to the point where it left in the caller..
Is there any technique to make the callee to return to some other
point(within the current process) other than the callee by changing
the call stack in callee...
My code runs on 86 processor
(If this thread is irrelevent to this group please kindly igore the
same)
thanks in advance

解决方案

In article <11**********************@y80g2000hsf.googlegroups .com>,
KIRAN <ki*****@gmail.comwrote:

>hi,

the grammer for any programming language says that when a function is
called by another function,the callee after executing it''s body should
return to the point where it left in the caller..

The grammar says no such thing. The grammar only describes syntax;
what happens when it runs is a matter of semantics.

>Is there any technique to make the callee to return to some other
point(within the current process) other than the callee by changing
the call stack in callee...

Use INTERCAL, which has a COME FROM statement for precisely this purpose.

Alternatively, use a functional programming language that lets you use
explicit continuations and invoke a continuation instead of returning.

Both of these can be done in (correct, portable) C if you try hard enough,
but You Don''t Want To Do That. Either re-frame the problem to fit your
tools or choose your tools to fit the problem.
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca

He doesn''t strike me as a learner, somehow. Let''s hope we''re wrong.
--Richard Heathfield in comp.lang.c


On Fri, 13 Apr 2007, Dave Vandervies wrote:

In article <11**********************@y80g2000hsf.googlegroups .com>,
KIRAN <ki*****@gmail.comwrote:

>hi,

the grammer for any programming language says that when a function is
called by another function,the callee after executing it''s body should
return to the point where it left in the caller..


The grammar says no such thing. The grammar only describes syntax;
what happens when it runs is a matter of semantics.

>Is there any technique to make the callee to return to some other
point(within the current process) other than the callee by changing
the call stack in callee...


Use INTERCAL, which has a COME FROM statement for precisely this purpose.

Alternatively, use a functional programming language that lets you use
explicit continuations and invoke a continuation instead of returning.

Both of these can be done in (correct, portable) C if you try hard enough,
but You Don''t Want To Do That. Either re-frame the problem to fit your
tools or choose your tools to fit the problem.

I don''t quite agree with this anti-goto mentality.

In some cases, setjmp and longjmp are actually better than
reframing the problem.

Tak-Shing


In article <Pi*******************************@scorpio.gold.ac .uk>,
Tak-Shing Chan <t.****@gold.ac.ukwrote:

>On Fri, 13 Apr 2007, Dave Vandervies wrote:

>In article <11**********************@y80g2000hsf.googlegroups .com>,
KIRAN <ki*****@gmail.comwrote:

>>Is there any technique to make the callee to return to some other
point(within the current process) other than the callee by changing
the call stack in callee...


Use INTERCAL, which has a COME FROM statement for precisely this purpose.

Alternatively, use a functional programming language that lets you use
explicit continuations and invoke a continuation instead of returning.

Both of these can be done in (correct, portable) C if you try hard enough,
but You Don''t Want To Do That. Either re-frame the problem to fit your
tools or choose your tools to fit the problem.


I don''t quite agree with this anti-goto mentality.

I see no anti-goto mentality here.

In some cases, setjmp and longjmp are actually better than
reframing the problem.

There''s not enough information to be certain, but the way the question
was stated is a pretty strong hint that the OP is looking for something
less restricted than setjmp/longjmp.
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca
That only tells you the time of execution. To calculate the speed, you will
also need to know the distance the program travels within that time.
--Richard Heathfield in comp.lang.c


这篇关于违反程序调用约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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