I would like to link a program where the main function is not called main
. For example:
#include <stdio.h>
int chef()
{
puts("Bonjour, monde!");
return 0;
}
How can this be done? For example using some command-line option for gcc
when linking to tell it the name of the main function?
If it is possible, then also is there a way to tell it at compile time that a particular named function has the special behavior of main
, where the return value defaults to 0 if the end of the function is reached (so that I could equally omit the return
statement in this example)?