Liste des Groupes | Revenir à c arch |
mitchalsup@aol.com (MitchAlsup1) writes:The Linux environment (crt0) calls main with 3 arguments.
>On Sat, 7 Sep 2024 23:45:45 +0000, Tim Rentsch wrote:>Another issue is that main() may not have the 3 defined arguments>
and the containing environment is not supposed to complain when
argc, arv, and envp are unused or even unnamed as arguments.
The usual "Hello, World" program defines main() either with no
arguments
>
int
main(){
...
}
>
or with two arguments
>
int
main( int argc, char *argv[] ){
...
}
>
and in both cases main() has defined behavior and does not
violate the strictures of strictly conforming programs.
If the surrounding OS or whatever cannot support these, that
doesn't change whether the program is strictly conforming. The
condition of being strictly conforming is a predicate on
programs, not on implementations.
Les messages affichés proviennent d'usenet.