C89 og C99 tillader andre signaturer i environments uden OS
C99 tillader ekstra signaturer for main i environments med OS hvis compiler producenten har dokumenteret saadanne.
5.1.2.1 Freestanding environment
1 In a freestanding environment (in which C program execution may take place without any
benefit of an operating system), the name and type of the function called at program
startup are implementation-defined. Any library facilities available to a freestanding
program, other than the minimal set required by clause 4, are implementation-defined.
2 The effect of program termination in a freestanding environment is implementationdefined.
5.1.2.2 Hosted environment
1 A hosted environment need not be provided, but shall conform to the following
specifications if present.
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;8) or in some other implementation-defined manner.
Oensker man at skrive portabel C kode skal main vaere int.
Fra C FAQ:
http://c-faq.com/ansi/voidmain.html