------- Additional Comments From chli002 at rz dot uni-saarland dot de 2005-01-10 15:32 ------- I have found similar cases; it appears that the crucial part is a {short;char} struct or union which is passed as a var arg. Here is a similar program, somewhat smaller and with easier to understand names. Again, on MacOS X 10.3 with gcc version 3.3 20030304:
$ ./foo foo.c:17: failed assertion `y.f == i.f' Abort trap #include <stdarg.h> #include <assert.h> union A { float a; double b; } c = { 52.54 }; struct B { double d; unsigned int e; } h = { 78.01, 834U }; union C { short int f; char g; } i = { 68 }; struct D { char j; double k; } n = { 'c', 31.01 }; struct E { long long int l; double m; } o = { 167L, 17.2 }; union A callee( struct D a, struct E b, ... ) { va_list ap; struct B x; union C y; va_start (ap, b); x = va_arg (ap, struct B); y = va_arg (ap, union C); assert (y.f == i.f); va_end (ap); return c; } int main( int argc, char **arg ) { union A r; r = callee (n, o, h, i); assert (c.a == r.a); return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18742