Created
November 4, 2013 06:56
-
-
Save hailinzeng/7298989 to your computer and use it in GitHub Desktop.
program without main
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gcc -o no_main no_main.c -nostartfiles | |
#include <stdio.h> | |
extern void _exit (register int code); | |
_start() | |
{ | |
int retval; | |
retval = my_main (); | |
_exit(retval); | |
} | |
int my_main(void) | |
{ | |
printf("Hello\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment