x86_64 fails to copy the second struct passed to va_arg. Notice that if you switch the position of bill= and george= it is always the second struct that fails to read.
$ gcc test.c && ./a.out #pass $ i386-tcc test.c && ./a.out #pass $ tcc test.c && ./a.out #fail failed in test.c: 20 test.c-------------------------- #include <stdio.h> #include <stdarg.h> #define failed() do { \ printf("failed in %s: %d\n", __FILE__, __LINE__); \ errors++; \ } while (0) static int errors = 0; static struct myspace { short int profile; } bob = { 42 }; void badfunc(int eek, ...) { va_list ack; int validate; struct myspace george, bill; va_start(ack, eek); bill = va_arg(ack, struct myspace); george = va_arg(ack, struct myspace); validate = va_arg(ack, int); if (bill.profile != bob.profile) failed(); if (george.profile != bob.profile) failed(); if (validate != bob.profile) failed(); va_end(ack); } void goodfunc(int eek, struct myspace george) { if (george.profile != bob.profile) failed(); } int main(int argc, char **argv) { goodfunc(0, bob); badfunc(0, bob, bob, bob.profile); return errors; } _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/tinycc-devel