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

[connect24h:6748] Re: プログラムの稼動監視ツール



Susumu Miwa <rin@xxxxxxxxxxxx> (三輪 晋):
> 「main() は return()、exit()、_exit() のいずれかを呼ぶこと。これにより
> 呼び出しもとのカーネル( あるいは親プロセス )は main() の終了状態を知る
> ことができる。上記以外の場合はプロセスの終了状態は未定義。なお、exit() 
> は ANSI C で規定されていて、_exit() は POSIX.1 で規定されている。」
> 
> C の規格は手元にないので「らしい」としかいえないのだけど、規格ではどの
> ような記述になっているのでしょう。

ISO/IEC 9899:1999 より:

5.1.2.2.1  Program startup

1   The function called at program startup is named /main/. The
    implementation declares no prototype for this function. It shall
    be defined with a return type of /int/ and with no parameters:

        int main(void) { /* ... */ }

    or with two parameters (refered to here as /argc/ and /argv/,
    though any names may be used, as tyey are local to the function
    in which they are declared):

        int main(int argc, char *argv[]) { /* ... */ }

    or equivalent;[*] or in some other implementation-defined manner.


[*] Thus, /int/ can be replaced by a typedef name defined as /int/,
    or the type of /argv/ can be written as /char ** argv/, and so on.

----
こがよういちろう

--[PR]------------------------------------------------------------------
/ ̄ \/ ̄ \ ♪ 今すぐあなたの理想の相手を教えて! ♪  / ̄ \/ ̄ \
\     / ━━━━━━━━━━━━━━━━━━━━  \     /
 \   /     新・結婚情報サービス サンマリエ     \   /
  \_/  年齢? 地域? 職業? 年収? あなたの希望条件は? \_/
        http://ad.freeml.com/cgi-bin/ad.cgi?id=cr2tL
------------------------------------------------------------------[PR]--
<GMO GROUP> Global Media Online  www.gmo.jp