Created
July 4, 2012 15:22
-
-
Save fjolnir/3047873 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
struct _va_list { | |
unsigned int gp_offset, fp_offset; | |
void *overflow_arg_area, *reg_save_area; | |
}; | |
int foo(int bar, ...) { | |
va_list lst; | |
va_start(lst, bar); | |
struct _va_list *list = &lst; | |
int *first = list->reg_save_area+list->gp_offset; | |
printf("%d\n", sizeof(int)); | |
printf("gpofs: %d fpofs: %d\n", list->gp_offset, list->fp_offset); | |
printf("arg: %d\n", *first); | |
va_end(lst); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment