Skip to content

Instantly share code, notes, and snippets.

@hailinzeng
Created November 4, 2013 06:56
Show Gist options
  • Save hailinzeng/7298989 to your computer and use it in GitHub Desktop.
Save hailinzeng/7298989 to your computer and use it in GitHub Desktop.
program without main
// 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