C++相談室 part10
■ このスレッドは過去ログ倉庫に格納されています
0593デフォルトの名無しさん
NGNGfreestanding まで視野に入れて議論するのは無意味だろ。そもそも組み込み系
だと「終了してはいけない = main から return した瞬間にハングアップ」とか「エン
トリポイントが main じゃない」とかもアリアリだから。
hosted environment では C99 でも main は int のみ。以下、規格書から抜粋。
> 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 (referred to here as argc and argv, though any names may be
> used, as they 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.
■ このスレッドは過去ログ倉庫に格納されています