0

below is what the C standard say about Program startup in C but i find the last part of the definition unclear:

or equivalent;10) or in some other implementation-defined manner.

i need to know what that exactly means any good references are appreciated

thanks in advance

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;10) or in some other implementation-defined manner.

  • Related: https://stackoverflow.com/questions/3974796/in-c-main-function-is-the-entry-point-to-program-how-i-can-change-it-to-an-oth https://stackoverflow.com/questions/7494244/how-to-change-entry-point-of-c-program-with-gcc – SuperStormer May 02 '21 at 19:19
  • The “implementation” of C is the compiler and the other parts needed to build and execute programs, such as header files, software libraries, operating system, and computer hardware. “Implementation-defined” means the C implementation must document the choices it makes. The compiler and other parts of the C implementation should have a manual, and that manual should list what formats of declaration it supports for `main`. That is what it means for `main` to be declared in “some other implementation-defined manner.” – Eric Postpischil May 03 '21 at 00:09
  • Also notably you are quoting the hosted implementation sub-chapter. In freestanding systems, the function called upon start-up is always implementation-defined. – Lundin May 03 '21 at 18:09

0 Answers0