EXIT_SUCCESS保证始终为零? [英] EXIT_SUCCESS guaranteed to always be zero?

查看:69
本文介绍了EXIT_SUCCESS保证始终为零?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最后,控制权返回给主机环境。如果

状态的值为零或EXIT_SUCCESS,则返回

状态成功终止的实现定义形式。


超出标准的这一段,我无法确定这个



将永远为零。如果是这样肯定会很方便但是

永远不会

直接说明这一点。 零或部分,让我相信



可能不是零,但我不太确定。


-

nethlek

Finally, control is returned to the host environment. If the value of
status is zero or EXIT_SUCCESS, an implementation-defined form of the
status successful termination is returned.

beyond this paragraph from the standard, I can''t determine if this
macro
will always be zero. It would surely be convenient if it is but it
never
states this directly. the "zero or" part, leads me to believe that the
macro
can be something other than zero, but I''m not too sure.

--
nethlek

推荐答案

在comp.lang.c中Mantorok Redgormor< ne **** *@tokyo.com>写道:
In comp.lang.c Mantorok Redgormor <ne*****@tokyo.com> wrote:
最后,控制权返回给主机环境。如果
status的值为零或EXIT_SUCCESS,则返回
状态成功终止的实现定义形式。超出此段标准的
,我无法确定这个
宏是否总是为零。如果它确实很方便,但它永远不会直接说明这一点。 零或部分,让我相信
宏可以是零以外的东西,但我不太确定。
Finally, control is returned to the host environment. If the value of
status is zero or EXIT_SUCCESS, an implementation-defined form of the
status successful termination is returned. beyond this paragraph from the standard, I can''t determine if this
macro
will always be zero. It would surely be convenient if it is but it
never
states this directly. the "zero or" part, leads me to believe that the
macro
can be something other than zero, but I''m not too sure.




你是正确的。标准的措辞并没有规定EXIT_SUCCESS的价值,也没有EXIT_FAILURE。


所有你必须知道的是0和EXIT_SUCCESS是功能性的/>
表示程序成功完成的同义词。实际上,

返回环境的值确实必须与程序中返回的值对应
。它只需要表明程序已成功完成,

以实现方式定义。


Alex



You are correct. The wording of the standard does not dictate the
value of EXIT_SUCCESS, nor EXIT_FAILURE.

All you have to know is that 0 and EXIT_SUCCESS are functional
synonyms that denote successful program completion. In fact,
the value returned to the environment does necessarily have
to correspond to the value returned within the program. It
just has to indicate that the program completed successfully,
in an implementation defined manner.

Alex


ne*****@tokyo.com (Mantorok Redgormor)写道:
ne*****@tokyo.com (Mantorok Redgormor) writes:
超出本段的标准,我无法确定这个宏是否总是为零。它肯定会很方便
如果是,但它永远不会直接说明这一点。 零或部分,
让我相信宏可以是零以外的东西,但我不太确定。
beyond this paragraph from the standard, I can''t determine if
this macro will always be zero. It would surely be convenient
if it is but it never states this directly. the "zero or" part,
leads me to believe that the macro can be something other than
zero, but I''m not too sure.




标准并不表示或暗示EXIT_SUCCESS总是

0,所以你不能依赖它。

-

您的更正是100%正确,0%有帮助。做得好!"

- 理查德希思菲尔德



The standard doesn''t state or imply that EXIT_SUCCESS is always
0, so you can''t portably depend on it.
--
"Your correction is 100% correct and 0% helpful. Well done!"
--Richard Heathfield


Alex< al ******* @ hotmail.com>写道:
Alex <al*******@hotmail.com> writes:
在comp.lang.c中Mantorok Redgormor< ne ***** @ tokyo.com>写道:
In comp.lang.c Mantorok Redgormor <ne*****@tokyo.com> wrote:
最后,控制权返回给主机环境。如果
status的值为零或EXIT_SUCCESS,则返回
状态成功终止的实现定义形式。
Finally, control is returned to the host environment. If the value of
status is zero or EXIT_SUCCESS, an implementation-defined form of the
status successful termination is returned.


超出此段落从标准来看,我无法确定这个
宏是否总是为零。它肯定会很方便,但它永远不会直接说明这一点。 零或部分,让我相信宏可以是零以外的东西,但我不太确定。
beyond this paragraph from the standard, I can''t determine if this
macro will always be zero. It would surely be convenient if it is but
it never states this directly. the "zero or" part, leads me to believe
that the macro can be something other than zero, but I''m not too sure.



你是对的。标准的措辞并没有规定EXIT_SUCCESS的值,也没有EXIT_FAILURE。

所有你必须知道的是0和EXIT_SUCCESS是功能的
同义词,表示程序成功完成。实际上,返回到环境的值必然与程序中返回的值相对应。它必须表明程序已成功完成,
以实现定义的方式。



You are correct. The wording of the standard does not dictate the
value of EXIT_SUCCESS, nor EXIT_FAILURE.

All you have to know is that 0 and EXIT_SUCCESS are functional
synonyms that denote successful program completion. In fact,
the value returned to the environment does necessarily have
to correspond to the value returned within the program. It
just has to indicate that the program completed successfully,
in an implementation defined manner.




0和EXIT_SUCCESS不一定是同义词(虽然标准中的措辞

可以被读取以表明它们是)。他们可以

表示不同类型的成功。当然,便携式程序

不能使用这种区别,如果有的话。


-

Keith汤普森(The_Other_Keith) ks***@mib.org < http://www.ghoti.net/~kst>

圣地亚哥超级计算机中心< *> < http://www.sdsc.edu/~kst>

Schroedinger做莎士比亚:要*和*不要

(注意新的e邮件地址)



0 and EXIT_SUCCESS aren''t necessarily synonymous (though the wording
in the standard could be read to indicate that they are). They could
indicate different kinds of success. Of course, a portable program
can''t make use of the distinction, if any.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
(Note new e-mail address)


这篇关于EXIT_SUCCESS保证始终为零?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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