The following works on i386, sparc32 and sparc64, but produces a compiler warning on x86-64, then prints garbage and crashses when run: --------------------------- #include <stdarg.h> #include <stdio.h> void func3(va_list *ap) { int test = va_arg(*ap,int); fprintf(stderr,"%d\n",test); } void func2(va_list ap) { func3(&ap); } void func1(int start, ...) { va_list ap; va_start(ap,start); func2(ap); va_end(ap); } int main() { fprintf(stderr,"This should print 1:\n"); func1(2,1); return 0; } --------------------------- test.c: In function `func2': test.c:10: warning: passing arg 1 of `func3' from incompatible pointer type --------------------------- This should print 1: -7609280 Segmentation fault
Created attachment 10851 [details] test.c
Created attachment 10852 [details] test.i
Created attachment 10853 [details] test.s
Your code is invalid for x86_64 (and ppc-linux). This is a dup of bug 14557. *** This bug has been marked as a duplicate of 14557 ***